Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cc914c5

Browse files
check input is between range
1 parent ab51f7d commit cc914c5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
LOW = 5
2+
HIGH = 35
3+
4+
def in_range(n,low,high):
5+
""" Returns True if n is between low and high,
6+
inclusive. high is guaranteed to be greater than low. """
7+
8+
if n >= low and n <= high:
9+
return "True"
10+
11+
return "False"
12+
13+
def main():
14+
user_input = int(input("Enter a number : "))
15+
print(in_range(user_input,LOW,HIGH))
16+
17+
if __name__ == "__main__":
18+
main()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /