Look at your code: the loop consists of three lines:
while userChoice2 not in ["1p", "2p", "5p", "10p", "20p", "50p", "£1", "£2"]:
print("Wrong input")
print("You have to pick one from" "1p", "2p", "5p", "10p", "20p", "50p", "£1", "£2")
But none of them change the value in
userchoice2
so once you enter the loop with a bad input, you will continually check the same bad value and print the same messages.
What you need to do is copy the
input
line so that after you print the error messages, you can get a new value:
userChoice2 = input("What is the coin type you want to count?: ")
while userChoice2 not in ["1p", "2p", "5p", "10p", "20p", "50p", "£1", "£2"]:
print("Wrong input")
print("You have to pick one from" "1p", "2p", "5p", "10p", "20p", "50p", "£1", "£2")
userChoice2 = input("What is the coin type you want to count?: ")