Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

using while loop in python taking input until it matches the desired answer

# take userinput and will keep asking same question
# until gets the desired/set output

i = 'yes'
while True:
    n = str(input('Are we going on a date?: '))
    if n == i:
        print('We are going on a Date')
        break
 
PREVIOUS NEXT
Tagged: #loop #python #input #matches #desired #answer
ADD COMMENT
Topic
Name
9+9 =