Jump to content

Search the Community

Showing results for tags 'infinite loop'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. Raj Midha

    Python Project

    Hello folks. I am currently learning Python programming. I have created a fill in the blanks quiz game. In this game, the user has to select a level hard, medium, easy. On the basis of teh level selected, the respective question and its answers are passed as parameters into the function, question validation, this function takes user input and sees whether is matches the question and answer input. If it does, then the answer is passed onto the function, traverse. At traverse, the blanks are filled in and the sentence is returned with missing blank filled in. This seems to work well upto filling in the fourth blank. At this stage if I get the answer wrong on the first attempt and I later answer correctly, it then prompts me to fill in the 4th again. Its acting like an infinite loop. I cant for the life of me seem to solve this!!!! The problem lies here: time.sleep(2) print "wrong answer you have", tries, " attempts left" while tries>0: print "Fill in ",blanks[index], " please" response = raw_input() response = response.upper() if response == answers[index]: time.sleep(2) print "congratulations!!! " traverse(question, answers, index) else: tries = tries - 1 print "wrong answer you have", tries, "attempts left" print "Arividechi" exit() codeaquiz.py
×