IT45200

Untitled

Dec 4th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. result = False
  2.  
  3. def Size(x):
  4.     x = int(x)
  5.     return [False, True] [x >= 1 and x <=10]
  6.  
  7. n = input("Enter a number between 1 and 10 : ")
  8.  
  9. while True:
  10.     try:
  11.         result = Size(n)            
  12.         break  
  13.     except:
  14.         n=input("You have to type a value : ")      
  15. print(result)
Advertisement
Add Comment
Please, Sign In to add comment