Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python do while

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
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #python
ADD COMMENT
Topic
Name
7+4 =