String comparison: Difference between revisions

→‎{{header|Python}}: case-insensitive string comparison
(more clarification)
(→‎{{header|Python}}: case-insensitive string comparison)
Line 179:
 
=={{header|Python}}==
Notes:
Note that* 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.uppser()</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