Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Looping problem
#3
If you want to ask the question over and over again until you get a correct answer, use a while loop:

while True:
    spanishs = input('Can you say my name is in Spanish?')
    if spanish == 'me llamo':
        print('Si. Correcto')
        break
    print('Intento equivocado otra vez. ' 'Wrong, try again!')
Always put everything you want to repeat in the loop.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Looping problem - by IMissedTheBus - Sep-03-2018, 11:43 AM
RE: Looping problem - by Axel_Erfurt - Sep-03-2018, 12:25 PM
RE: Looping problem - by ichabod801 - Sep-03-2018, 12:45 PM
RE: Looping problem - by IMissedTheBus - Sep-03-2018, 01:08 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020