I wonder how to compare strings in Python.
str1 = "test"
str2 = "test"
print (str1 == str2)
This is the case of comparing only simple matches, as shown above.
When I searched, I couldn't find anything except ==.
Is there a function that functions similar to Java's equals?
python string
There's an operator module
Among them, you can use it like Java equals using eq
(My environment is Python 3, but I'm not sure about 2. I guess so )
© 2024 OneMinuteCode. All rights reserved.