Draw the flowchart for this python program ?   def new_game():     guesses = []     correct_guesses = 0     question_num = 1     for key in questions:         print("-------------------------")         print(key)         for i in options[question_num-1]:             print(i)         guess = input("Enter (A, B, C, or D): ")         guess = guess.upper()         guesses.append(guess)         correct_guesses += check_answer(questions.get(key), guess)         question_num += 1     display_score(correct_guesses, guesses) # ------------------------- def check_answer(answer, guess):     if answer == guess:         print("CORRECT!")         return 1     else:         print("WRONG!")         return 0 # ------------------------- def display_score(correct_guesses, guesses):     print("-------------------------")     print("RESULTS")     print("-------------------------")     print("Answers: ", end="")     for i in questions:         print(questions.get(i), end=" ")     print()     print("Guesses: ", end="")     for i in guesses:         print(i, end=" ")     print()     score = int((correct_guesses/len(questions))*100)     print("Your score is: "+str(score)+"%") # ------------------------- def play_again():     response = input("Do you want to play again? (yes or no): ")     response = response.upper()     if response == "YES":         return True     else:         return False # ------------------------- questions = {  "Who created Python?: ": "A",  "What year was Python created?: ": "B",  "Python is tributed to which comedy group?: ": "C",  "Is the Earth round?: ": "A" } options = [["A. Guido van Rossum", "B. Elon Musk", "C. Bill Gates", "D. Mark Zuckerburg"],           ["A. 1989", "B. 1991", "C. 2000", "D. 2016"],           ["A. Lonely Island", "B. Smosh", "C. Monty Python", "D. SNL"],           ["A. True","B. False", "C. sometimes", "D. What's Earth?"]] new_game() while play_again():     new_game() print("Byeeeeee!") # -------------------------

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Draw the flowchart for this python program ?

 

def new_game():

    guesses = []
    correct_guesses = 0
    question_num = 1

    for key in questions:
        print("-------------------------")
        print(key)
        for i in options[question_num-1]:
            print(i)
        guess = input("Enter (A, B, C, or D): ")
        guess = guess.upper()
        guesses.append(guess)

        correct_guesses += check_answer(questions.get(key), guess)
        question_num += 1

    display_score(correct_guesses, guesses)

# -------------------------
def check_answer(answer, guess):

    if answer == guess:
        print("CORRECT!")
        return 1
    else:
        print("WRONG!")
        return 0

# -------------------------
def display_score(correct_guesses, guesses):
    print("-------------------------")
    print("RESULTS")
    print("-------------------------")

    print("Answers: ", end="")
    for i in questions:
        print(questions.get(i), end=" ")
    print()

    print("Guesses: ", end="")
    for i in guesses:
        print(i, end=" ")
    print()

    score = int((correct_guesses/len(questions))*100)
    print("Your score is: "+str(score)+"%")

# -------------------------
def play_again():

    response = input("Do you want to play again? (yes or no): ")
    response = response.upper()

    if response == "YES":
        return True
    else:
        return False
# -------------------------


questions = {
 "Who created Python?: ": "A",
 "What year was Python created?: ": "B",
 "Python is tributed to which comedy group?: ": "C",
 "Is the Earth round?: ": "A"
}

options = [["A. Guido van Rossum", "B. Elon Musk", "C. Bill Gates", "D. Mark Zuckerburg"],
          ["A. 1989", "B. 1991", "C. 2000", "D. 2016"],
          ["A. Lonely Island", "B. Smosh", "C. Monty Python", "D. SNL"],
          ["A. True","B. False", "C. sometimes", "D. What's Earth?"]]

new_game()

while play_again():
    new_game()

print("Byeeeeee!")

# -------------------------

Expert Solution
steps

Step by step

Solved in 4 steps with 6 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY