About 257,000 results
Open links in new tab
  1. String comparison in Python: is vs. == - Stack Overflow

    (In other words it compares value) For JAVA people: In Java, to determine whether two string variables reference the same physical memory location by using str1 == str2. (called object identity, and it is …

  2. python - How are strings compared? - Stack Overflow

    Many people ask this question when the strings contain representations of numbers, and want to compare the numbers by numeric value. The straightforward solution is to convert the values first. …

  3. python - Why does comparing strings using either '==' or 'is' …

    Python does this, so does Java, and so do C and C++ when compiling in optimized modes. If you use two identical strings, instead of wasting memory by creating two string objects, all interned strings …

  4. Comparing a string to multiple items in Python - Stack Overflow

    Aug 6, 2013 · I'm trying to compare a string called facility to multiple possible strings to test if it is valid. The valid strings are: auth, authpriv, daemon, cron, ftp, lpr, kern, mail, news, syslog, user, u...

  5. How do I compare version numbers in Python? - Stack Overflow

    Aug 9, 2012 · How do I compare version numbers in Python? Asked 13 years, 4 months ago Modified 5 months ago Viewed 292k times

  6. python - How do I do a case-insensitive string comparison ... - Stack ...

    810 How can I compare strings in a case insensitive way in Python? I would like to encapsulate comparison of a regular strings to a repository string, using simple and Pythonic code. I also would …

  7. how does string comparison work on python? - Stack Overflow

    Nov 15, 2012 · how does string comparison work on python? [duplicate] Asked 13 years, 1 month ago Modified 1 year, 2 months ago Viewed 5k times

  8. python - Compare string with all values in list - Stack Overflow

    Compare string with all values in list Asked 15 years, 7 months ago Modified 4 years, 10 months ago Viewed 181k times

  9. python - How to check if a variable is equal to one string or another ...

    Oct 8, 2012 · 'is' is used to check if the two references are referred to a same object. It compare the memory address. Apparently, 'stringone' and 'var' are different objects, they just contains the same …

  10. Python: Compare strings with 'or' operator - Stack Overflow

    Jun 21, 2016 · Python: Compare strings with 'or' operator [duplicate] Asked 9 years, 6 months ago Modified 9 years, 6 months ago Viewed 5k times