Advertisement
182days

Number Checker

May 10th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. #number checker
  2. while True:
  3.     print("please enter a whole number or type exit to close...")
  4.     x=input("")
  5.     if str (x) == "exit":
  6.         break
  7.     elif int (x) <0:
  8.         print("you entered a negative value!")
  9.     elif int (x) >=0 and int (x)<=9:
  10.         print("you entered a number between 0 and 9!")
  11.     elif int (x) >9 and int (x)<=99:
  12.         print("you entered a number in the 10's!")
  13.     elif int (x) >99 and int (x)<=999:
  14.         print("you entered a number in the 100's!")
  15.     elif int (x) >999 and int (x)<=999999:
  16.         print("you entered a number in the 1000's!")
  17.     elif int (x) >999999:
  18.         print("you entered a number greater than 1,000,000!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement