Answers for "while loop condition in python"

0

python do while loop

secret_word = "python"
counter = 0

while True:
    word = input("Enter the secret word: ").lower()
    counter = counter + 1
    if word == secret_word:
        break
    if word != secret_word and counter > 7: 
        break
Posted by: Guest on December-22-2021

Python Answers by Framework

Browse Popular Code Answers by Language