-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkbc.py
47 lines (42 loc) · 1.48 KB
/
kbc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Questions = [{
"Question" : "Q1.Which is largest Country in world ?",
"Option" : ["1.India 2.America 3.Russia 4.China"],
"Answer" : 3
},{
"Question" : "Q2.Which is Smallest Country in world ?",
"Option" : ["1.SriLanka 2.Nepal 3.Russia 4.Indonesia"],
"Answer" : 1
},{
"Question" : "Q3.Which is Expensive Country in world ?",
"Option" : ["1.America 2.Pakistan 3.Dubai 4.China"],
"Answer" : 1
},{
"Question" : "Q4.Which is largest Country in Population in world ?",
"Option" : ["1.Nepal 2.America 3.Pakistan 4.China"],
"Answer" : 4
},{
"Question" : "Q5.Which is largest Country Across Area in world ?",
"Option" : ["1.India 2.Bhutan 3.Russia 4.SriLanka"],
"Answer" : 3
}]
PriceWon = 0
QuestionIndex = 0
GameOver = False
PlayerName = str(input("Please Enter Your Name : ")).capitalize()
print("So", "Mr/Mrs." + PlayerName, "Let's Begin :>")
while not GameOver:
Question = Questions[QuestionIndex]
print(Question["Question"])
for option in Question["Option"]:
print(option)
UserAnswer = int(input("Enter The Number Of Correct Option : "))
if UserAnswer == Question["Answer"]:
print("Congratualtion, You Have Choice Correct Option!")
PriceWon += 1000
else:
print("You Have Chosen Incorrect Option!")
GameOver = True
QuestionIndex += 1
if QuestionIndex == len(Questions):
GameOver = True
print("Mr."+PlayerName,"Total Price You Have Won ₹" ,PriceWon)