Jump to content

String comparison: Difference between revisions

m
Line 181:
Notes:
* Python is strongly typed. The string '24' is never coerced to a number, (or vice versa).
* Python does not have case-insensitive string comparison operators, instead use <code>name.uppserupper()</code> or <code>name.lower()</code> to coerce strings to the same case and compare the results.
<lang python>def compare(a, b):
print("\n%r is of type %r and %r is of type %r"
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.