I have a homework assignment that I am very confused about. I have to write a program allowing users to input the number of eggs that they are buying. The program will then
Let the user enter anything he wishes, and warn only if it wasn't an integer:
try: num = int(input("enter number: ")) except ValueError: print("you must enter an integer")
This is the Pythonic way to do it, after all it's "Easier to ask forgiveness than permission".