forked from souravjain540/Basic-Python-Programs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquiz.py
37 lines (37 loc) · 1.18 KB
/
quiz.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
print('Welcome to Quiz on Python')
answer=input('Are you ready to play the Quiz ? (yes/no) : ')
score=0
total_questions=3
if answer.lower()=='yes':
answer=input('Question 1: Who is the founder of Python ? ')
a = 'Guido van Rossum'
if answer.lower()=='a':
score += 1
print('correct')
else:
print('Wrong Answer :(')
print('The correct answer is :',a)
answer=input('Question 2: Is Python is interpreted language ? ')
b = 'yes'
if answer.lower()== b:
score += 1
print('correct')
else:
print('Wrong Answer :(')
print('The correct answer is :',b,'Python is interpreted language')
answer=input('Question 3: Whether Python is dynamically typed language or statically typed language ? ')
c = 'dynamically typed language'
if answer.lower()== c:
score += 1
print('correct')
else:
print('Wrong Answer :(')
print('The correct answer is : Python is dynamically typed language')
print()
print()
print('Thankyou for Playing this small quiz game. You attempted',score,"questions correctly!")
mark=(score/total_questions)*100
print()
print('Marks obtained:',mark)
print()
print('BYE!')