Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/String-comparison/Python/string-comparison.py
Normal file
17
Task/String-comparison/Python/string-comparison.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
def compare(a, b):
|
||||
print("\n%r is of type %r and %r is of type %r"
|
||||
% (a, type(a), b, type(b)))
|
||||
if a < b: print('%r is strictly less than %r' % (a, b))
|
||||
if a <= b: print('%r is less than or equal to %r' % (a, b))
|
||||
if a > b: print('%r is strictly greater than %r' % (a, b))
|
||||
if a >= b: print('%r is greater than or equal to %r' % (a, b))
|
||||
if a == b: print('%r is equal to %r' % (a, b))
|
||||
if a != b: print('%r is not equal to %r' % (a, b))
|
||||
if a is b: print('%r has object identity with %r' % (a, b))
|
||||
if a is not b: print('%r has negated object identity with %r' % (a, b))
|
||||
|
||||
compare('YUP', 'YUP')
|
||||
compare('BALL', 'BELL')
|
||||
compare('24', '123')
|
||||
compare(24, 123)
|
||||
compare(5.0, 5)
|
||||
Loading…
Add table
Add a link
Reference in a new issue