Advertisement
jabela

WithFunctionWhile

May 11th, 2019
1,037
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. my_input = ""
  2. CowID = []
  3.  
  4. def validate():
  5.     ID = input("What is the cow's ID code?")
  6.     if len(ID) == 3:
  7.         return ID
  8.     else:
  9.         print("Cow ID has been entered wrongly.")
  10.         return ""
  11.    
  12. while my_input =="":
  13.    my_input = validate()
  14. CowID.append(my_input)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement