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
while True:
try:
amount=int(input("how many do you want to buy"))
break
except ValueError:
print("Please Enter An Amount")
continue
else:
break
This is a simple way of making the user inputs an integer in python 3. This can also be for making sure the user inputs a string all you need to do for this is just change int(.into str(