Created
December 5, 2019 01:28
-
-
Save FerdinaKusumah/d5b88a8a0b98f7880f4755d94279f851 to your computer and use it in GitHub Desktop.
Chain Comparison
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Chain comparison""" | |
min_num = 5 | |
max_num = 10 | |
search = 3 | |
is_middle = search < min_num < max_num | |
is_name = search == 3 < min_num < max_num | |
print("is number {} in middle {} and {} ? {}".format(search, min_num, max_num, is_middle)) | |
# is number 3 in middle 5 and 10 ? True | |
print("is number {} is same with 3 and in middle {} and {} ? {}".format(search, 3, min_num, max_num, is_middle)) | |
# is number 3 is same with 3 and in middle 3 and 5 ? 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment