fork download
  1. def Key(key):
  2. while len(key) < 1:
  3. print("Please enter a key")
  4. key = raw_input("What is the key: ")
  5. while key.isalpha() == True :
  6. print("Please enter a number!")
  7. key = raw_input("What is the key: ")
  8. key=int(key)
  9. while (key > 25) or (key < -25):
  10. print("The key must be in between numbers 26 and -26")
  11. key = int(raw_input("What is the key: "))
  12. print key
  13.  
  14. key = raw_input("What is the key: ")
  15. Key(key)
Success #stdin #stdout 0.01s 9016KB
stdin
a
26
25
stdout
What is the key: Please enter a key
What is the key: Please enter a number!
What is the key: The key must be in between numbers 26 and -26
What is the key: 25