About 51 results
Open links in new tab
  1. Examples for string find in Python - Stack Overflow

    Jul 7, 2013 · Python might in general prefer exceptions, but many users expect there to be a non-exception-raising-find-index method as well, especially as that's how it's done in almost every other …

  2. Python string find() method - Stack Overflow

    Jul 19, 2017 · Python find (sub) method return the lowest index where the substring sub is found and return -1 if its not. In first piece of code, name.find ("Sac") returns "0", because index of "S" in Sachin …

  3. How to get the position of a character in Python? - Stack Overflow

    Feb 19, 2010 · 6 If you want to find the first match. Python has a in-built string method that does the work: index ().

  4. python - Find a value in a list - Stack Overflow

    There is an abstraction in here to define a find function. Just encapsulate the the boolean expession of the if in a lambda & you can write find(fn,list) usually instead of obfuscating generator code.

  5. python 3.x - find () method in python3 - Stack Overflow

    Jan 24, 2017 · 2 I'm unable to understand what's the second argument in the find method in python3 is for.I searched it online but couldn't get a satisfactory explanation.For ex, please explain the use of …

  6. python - find ()関数、複数の文字列を扱うには? - スタック・オー …

    Jul 11, 2021 · find関数により、任意の文字列の頭のインデックスが求められます。 str1 = "abcdefghijklmn" print (str1.find ('cde')) #2 では、同様に、任意の文字列が複数ある場合は、どのよう …

  7. python - Why does string.find () return -1? - Stack Overflow

    Mar 30, 2018 · Really helpful. @PHD In most cases like this (including the otherwise-identical str.index, which is also available on other sequences), Python returns failure by raising an appropriate …

  8. Find the nth occurrence of substring in a string - Stack Overflow

    This seems like it should be pretty trivial, but I am new at Python and want to do it the most Pythonic way. I want to find the index corresponding to the n'th occurrence of a substring within a s...

  9. how can I find out which python virtual environment I am using?

    Dec 28, 2018 · I have several virtual environment in my computer and sometimes I am in doubt about which python virtual environment I am using. Is there an easy way to find out which virtual …

  10. python - Find maximum value of a column and return the …

    Apr 1, 2013 · Find maximum value of a column and return the corresponding row values using Pandas Asked 12 years, 8 months ago Modified 9 months ago Viewed 650k times