available_fruits = ['apple', 'grape', 'banana']
choice = input('Please pick a fruit I have available: ')
while True : choice= input('You made an invalid choice. Please pick again:')
if choice not in available_fruits
else print('You can have the fruit')
I want to make this loop stop when user inputs something in the list "available_fruits". But when I enter 'apple', it says "You can have the fruit" but as well as "You made an invalid choice. Please pick again:" again.
How can I make this loop to stop when I enter the fruit which is in the list? when I put the "break" at the end of the code, it says its an invalid syntax..