Skip to content

Commit 75bc574

Browse files
author
balgowlah-deli
committed
Create quiz_game.py
1 parent a79e255 commit 75bc574

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

quiz_game.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import time
2+
3+
true = ["T", "t", "True", "true"]
4+
false = ["F", "f", "False", "false"]
5+
correct = 0 #Storing the correct answers
6+
7+
name = input ("What's your name?") #Storing the user's name
8+
9+
print ("\nOK, " + name +", let's get started. Remember, the following answers are only True or False (you can answer true as 't' and false as 'f')")
10+
time.sleep(2)
11+
12+
print ("\nPython good for making commplex gmaes ")
13+
choice = input(">>> ")
14+
if choice in false:
15+
correct += 1 #If correct, the user gets one point
16+
else:
17+
correct += 0
18+
19+
print ("\nEngland is not an island.")
20+
choice = input(">>> ")
21+
if choice in true:
22+
correct += 1
23+
else:
24+
correct += 0
25+
26+
print ("\nNorthern Ireland is part of Great Britian.")
27+
choice = input(">>> ")
28+
if choice in true:
29+
correct += 1
30+
else:
31+
correct += 0
32+
33+
print ("\nMicrosoft originated in the UK")
34+
choice = input(">>> ")
35+
if choice in false:
36+
correct += 1
37+
else:
38+
correct += 0
39+
40+
print ("\nIran use to be part of the Perisan Empire.")
41+
choice = input(">>> ")
42+
if choice in true:
43+
correct += 1
44+
else:
45+
correct += 0
46+
47+
print ("\nWasikstan is a real contry")
48+
choice = input(">>> ")
49+
if choice in false:
50+
correct += 1
51+
else:
52+
correct += 0
53+
54+
print ("\nBONUS POINTS!: When adding a favicon to a website, the following HTML code would work: '<link rel=icon href=#'")
55+
choice = input(">>> ")
56+
if choice in false:
57+
correct += 2
58+
else:
59+
correct += 0
60+
61+
time.sleep(1)
62+
if correct <4:
63+
print ("\nOh no you got less than 4 right")
64+
time.sleep(2)
65+
print ("\nYou're finished, " + name +". You got", correct, "out of 8 possible points (7 questions, the last question was worth 2 points).")

0 commit comments

Comments
 (0)