How to print only once in a while loop

Viewed 17

So i want the code to print only once after else statement.

method = input("Play against a bot or a another user (bot/user): ")

while method != "bot" or "user":
    if method.lower() == "bot":
        pass
    elif method.lower() == "user":
        pass
    else:
        print("[!] You must choose between bot or user")

I want it to ask the the bot or user input again if user didn't provide correct choice.

0 Answers
Related