Mar-30-2017, 05:51 AM
Hey there.
I need some help and guidance in breaking down a long function but can seem to grasp exactly how....:
Any help would be greatly appreciated!! :) Onelove!
I need some help and guidance in breaking down a long function but can seem to grasp exactly how....:
Any help would be greatly appreciated!! :) Onelove!

def play_game(): level = get_level() quiz = game_data[level]['quiz'] print quiz answers_list = game_data[level]['answers'] blanks_index = 0 game_over = 0 answers_index = 0 guesses = 3 while blanks_index < len(blanks): user_answer = raw_input("So what's your answer to question " + blanks[blanks_index] + "? : ") if check_answer(user_answer,answers_list,answers_index) == "right_answer": print "nice job! that is the right answer!\n" quiz = quiz.replace(blanks[blanks_index], user_answer.upper()) blanks_index += 1 answers_index += 1 guesses = 3 print quiz if blanks_index == len(blanks): time.sleep (3) else: guesses -= 1 if guesses == game_over: print "Wawaooohh, you lost..... :(" time.sleep (3) break else: print "please try again. one guess down."