f = open("CoinCount.txt","r")
print(f.readline())
print(f.readline())
print(f.readline())
print(f.readline())
userChoice = input(" Which option would you like to open: Enter 1,2,3 or 4:")
if userChoice == "1":
presence_check = False
while presence_check == False:
name = input("What is the volunteers name?: ")
if len(name) <1:
print("Please enter your name again")
else:
print("Thank You!")
presence_check = True
userChoice2 = input("What is the coin type you want to count?: ")
while userChoice2 == False:
if userChoice2 in ["1p", "2p", "5p", "10p", "20p", "50p", "£1", "£2"]:
print("Thank You!")
userChoice2 == True
else:
userChoice2 == False
userChoice3 = input("What is the weight of the coin bag?: ")
if userChoice3 <= 100:
print("You need to add some more coins to the bag")
else:
print("Your bag has the correct weight")
The part where the program asks for a coin type is the part I am struggling with. I don't know how to get the program to re ask the user for a coin type if an invalid one is entered.