Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

while loop user input python

# 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 #user #input #python
ADD COMMENT
Topic
Name
2+5 =