MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / main

Function main

src/gamesbyexample/countingquiz.py:13–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12
13def main():
14 print('''Counting Quiz, by Al Sweigart al@inventwithpython.com
15
16 Use multiplication and subtraction to count the number of stars
17 shown as fast as possible. For example:
18
19 * * * * * *
20 * * * * *
21 * * * * *
22
23 This is a 6 x 3 star field with 2 missing stars.
24 The answer is 6 x 3 - 2 = 16
25
26 The quiz is 60 seconds long.
27 ''')
28
29 while True:
30 input('Press Enter to begin...')
31 runQuiz()
32 print('Would you like to play again? Y/N')
33 response = input('> ').upper()
34 if not response.startswith('Y'):
35 print('Thanks for playing!')
36 break
37
38
39def runQuiz():

Callers 1

countingquiz.pyFile · 0.70

Calls 1

runQuizFunction · 0.85

Tested by

no test coverage detected