Where I can add numeric operators (showed  below) to this project?   ** * / % // + –

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

Where I can add numeric operators (showed  below) to this project?  

    • **

    • *

    • /

    • %

    • //

    • +

Please type exactly where and how.

 

Main.py3.py
name = 1lnput(¯wnat is yor name?“)
7
name = name.title()
8.
print("""Hello {},welcom to geography quiz game!
9.
You will be presented with 10 questions about the USA geography.
tt nt ftm the hck m
10
Good luck!""". format(name))
11
12
def new_quizgame():
#Definition of first function that display quiz game
etm th tn t ta d
13
14
guesses =
[]
E i
n fra
1at
15
correct_guesses
#Number of guesses
= 0
16
question_num
#Number of question
17
18
for key in questions:
#This statment will separeted each question
print ("-
print (key)
for i in options [question_num-1]:
print(i)
19
")
20
21
22
23
guess =
input ("Enter (A, B, C, or D): ")
24
guess
guess.upper()
#This line of code allowed user to put answer not only in capital letter
25
guesses.append (guess)
26
27
correct_guesses += check_answer(questions.get(key), guess)
28
question_num += 1
#Dispaly options for questions
29
30
display_score(correct_guesses, guesses)
31
32
def check_answer(answer, guess):
#Definition of second function that check answer
33
34
if answer == guess:
35
print("Correct!")
36
return 1
37
else:
38
print ("Wrong!")
39
return 0
#Definition of third function that display score
def display_score(correct_guesses, guesses):
print(".
print ("Results")
40
41
")
#This line will separte the questions from results
42
Transcribed Image Text:Main.py3.py name = 1lnput(¯wnat is yor name?“) 7 name = name.title() 8. print("""Hello {},welcom to geography quiz game! 9. You will be presented with 10 questions about the USA geography. tt nt ftm the hck m 10 Good luck!""". format(name)) 11 12 def new_quizgame(): #Definition of first function that display quiz game etm th tn t ta d 13 14 guesses = [] E i n fra 1at 15 correct_guesses #Number of guesses = 0 16 question_num #Number of question 17 18 for key in questions: #This statment will separeted each question print ("- print (key) for i in options [question_num-1]: print(i) 19 ") 20 21 22 23 guess = input ("Enter (A, B, C, or D): ") 24 guess guess.upper() #This line of code allowed user to put answer not only in capital letter 25 guesses.append (guess) 26 27 correct_guesses += check_answer(questions.get(key), guess) 28 question_num += 1 #Dispaly options for questions 29 30 display_score(correct_guesses, guesses) 31 32 def check_answer(answer, guess): #Definition of second function that check answer 33 34 if answer == guess: 35 print("Correct!") 36 return 1 37 else: 38 print ("Wrong!") 39 return 0 #Definition of third function that display score def display_score(correct_guesses, guesses): print(". print ("Results") 40 41 ") #This line will separte the questions from results 42
Main.py3.py
43
print("
-")
44
print("Answers: ", end=" ")
for i in questions:
45
46
Rettam t futam the tk mr
print(questions.get(i), end=" ")
print ()
47
密 。
48
49
ttan uth ftan th t
50
print("Guesses:
end=" ")
rev.
S d tu t ! tum et a
51
for i in guesses:
tam
52
print(i, end=" ")
53
print()
54
#This line will count our score in percentage
score = int((correct_guesses/len(questions))*100)
print("Your scor is: " +str(score)+"%")
55
56
# This line will print our score
57
58
def play_again():
#Definition of fourth function that ask if you want to play again
59
60
response
= input("Do you want to play again? (yes or no): ")
61
response = response.upper()
62
63
if response == "YES'":
64
return True
65
else:
66
return False
67
68
questions
{
%D
69
"How many States are in the United States?: ": "A",
70
"What is the highest point of the US?: ": "C",
71
"Which state has the nickname 'The Land of 1,000 Lakes'?: ": "B'".
72
"What is the lowest point of the US?: ": "C",
73
"Which US state is known as 'The Garden State'?: ": "D"
74
}
#Dictionary named question (contain all questions and correct
answers from quzi game)
75
76
options = [["A. 50", "B.48", "C.52", "D.51"],
77
["A.Mount Saint Elias", "B.Mount Foraker", "C.Denali", "D.Mount Bona"],
Transcribed Image Text:Main.py3.py 43 print(" -") 44 print("Answers: ", end=" ") for i in questions: 45 46 Rettam t futam the tk mr print(questions.get(i), end=" ") print () 47 密 。 48 49 ttan uth ftan th t 50 print("Guesses: end=" ") rev. S d tu t ! tum et a 51 for i in guesses: tam 52 print(i, end=" ") 53 print() 54 #This line will count our score in percentage score = int((correct_guesses/len(questions))*100) print("Your scor is: " +str(score)+"%") 55 56 # This line will print our score 57 58 def play_again(): #Definition of fourth function that ask if you want to play again 59 60 response = input("Do you want to play again? (yes or no): ") 61 response = response.upper() 62 63 if response == "YES'": 64 return True 65 else: 66 return False 67 68 questions { %D 69 "How many States are in the United States?: ": "A", 70 "What is the highest point of the US?: ": "C", 71 "Which state has the nickname 'The Land of 1,000 Lakes'?: ": "B'". 72 "What is the lowest point of the US?: ": "C", 73 "Which US state is known as 'The Garden State'?: ": "D" 74 } #Dictionary named question (contain all questions and correct answers from quzi game) 75 76 options = [["A. 50", "B.48", "C.52", "D.51"], 77 ["A.Mount Saint Elias", "B.Mount Foraker", "C.Denali", "D.Mount Bona"],
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning