Last active
May 28, 2020 22:45
-
-
Save JohnsonLuu/8fc53530b3a0b65e1180bf1ebc387120 to your computer and use it in GitHub Desktop.
This file contains 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
""" | |
Create a function named in_range() that has three parameters named num, lower, and upper. | |
The function should return True if num is greater than or equal to lower and less than or equal to upper. Otherwise, return False. | |
""" | |
# Write your in_range function here: | |
def in_range(num, lower, upper): | |
if (num >= lower and num <= upper): | |
return True | |
else: | |
return False | |
# Uncomment these function calls to test your in_range function: | |
print(in_range(10, 10, 10)) | |
# should print True | |
print(in_range(5, 10, 20)) | |
# should print False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment