-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathv10_Quize-game.py
57 lines (49 loc) · 1.83 KB
/
v10_Quize-game.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
48
49
50
51
52
53
54
55
56
57
print("Welcome!!")
person = input("Please enter your name for better experience: ")
print("Hey "+person+" Welcome!!")
score = 0
questions = 5
print(person+" Are you ready to play?? ")
ready = input()
if ready == "yes":
question1 = input("What is the color of an apple?? ")
if question1 =="red":
score +=1
print(person+" Your answer is Correct 👌👍")
else:
print(person+" Your answer is incorrect 😥😥")
print("Note: Give your answer in integer only")
question2 = int(input("How many letters are there in alphabets?? "))
if question2 == 26:
score +=1
print(person+" Your answer is Correct 👌👍")
else:
print(person+" Your answer is incorrect 😥😥")
question3 = input("Which planet is known as red planet?? ")
if question3 =="mars":
score +=1
print(person+" Your answer is Correct 👌👍")
else:
print(person+" Your answer is incorrect 😥😥")
question4 = input("In which direction soes the sun rise?? ")
if question4 =="east":
score +=1
print(person+" Your answer is Correct 👌👍")
else:
print(person+" Your answer is incorrect 😥😥")
question5 = input("Have you subscribe Code With Niranjan?? ")
if question5 =="yes":
score +=1
print(person+" Very good 👌👍")
else:
score -=1
print(person+" Go and subscribe now 😥😥")
print("Very good try "+ person)
print("Your details\nYour name: " + str(person) + "\nYour score: "+str(score))
print("\nYou got "+str(score)+" Out of "+ str(questions))
final_marks = (score/questions)*100
print("You percentage is "+ str(final_marks)+ "%")
else:
print("Ok")
print("Come again Soon!!!")
print("Closing!")