Skip to content

Commit 872587f

Browse files
authored
Merge pull request larymak#205 from mvisic/main
Create hacktoberfest-quiz.py
2 parents 53b7911 + 9afaccd commit 872587f

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
print('Welcome to the Hacktoberfest 2022 Quiz')
2+
answer=input('Are you ready to play the Quiz ? (yes/no) :')
3+
score=0
4+
total_questions=3
5+
6+
if answer.lower()=='yes':
7+
answer=input('Question 1: What programming language was this quiz created in?')
8+
if answer.lower()=='python':
9+
score += 1
10+
print('correct')
11+
else:
12+
print('Wrong Answer :(')
13+
14+
15+
answer=input('Question 2: Is one of the values of Hacktoberfest 2022 "EVERYONE IS WELCOME" ? ')
16+
if answer.lower()=='yes':
17+
score += 1
18+
print('correct')
19+
else:
20+
print('Wrong Answer :(')
21+
22+
answer=input('Question 3: Does Hacktoberfest end on December 31?')
23+
if answer.lower()=='no':
24+
score += 1
25+
print('correct')
26+
else:
27+
print('Wrong Answer :(')
28+
29+
print('Thankyou for Playing the Hacktoberfest quiz game, you attempted',score,"questions correctly!")
30+
mark=(score/total_questions)*100
31+
print('Marks obtained:',mark)
32+
print('BYE!')

0 commit comments

Comments
 (0)