-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKBC.py
More file actions
32 lines (22 loc) · 1.1 KB
/
KBC.py
File metadata and controls
32 lines (22 loc) · 1.1 KB
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
# Online Python compiler (interpreter) to run Python online.
# Write Python 3 code in this online editor and run it.
questions = ["How many oceans are there in world?",
"Which planet is known as red planet?",
"Who is known as missile man of india?"]
options = ["A. 6 , B. 8 , C. 5 , D. 4",
"A. Jupiter , B. Mars , C. Earth , D. Neptune",
"A. Mahatma gandhi , B. APJ Kalam , C. Rbindranath tagore , D. Manmohan singh"]
answers = ["C", "B" , "B"]
prize_money = [1000, 4000, 8000]
total_winnings = 0
for i in range(len(questions)):
print(f"question{i+1}: {questions[i]}")
print(f"options: {options[i]}")
user_input = input("Enter your answer from given A,B,C,D options!").strip().upper()
if user_input == answers[i]:
print("You entered right answer")
total_winnings += prize_money[i]
else:
print(f"Wrong answer, correct answer is {answers[i]}")
break
print(f"Congratulations you are taking home: ${total_winnings}!")