If you guys love to make a quiz in google forms, MS Forms, etc. Today we will see how to make a quiz in Pycharm using python.
I will not go briefly but will share the code which you can copy and paste to use.
so, here is the code:
import time
A = input("Hi! Enter Your Name:")
print("Welcome " + A)
B = input("Do you want to participate in the quiz? Type YES/NO:")
print(B)
if B == 'YES':
print('Welcome! We would like to have you in the game...')
time.sleep(2)
print('Instructions: 1.Options will be given and write the correct answer according to the questions.'
'2. Your Data will not be stored. 3.Write as it is given in the options even for YES/NO'
'4.This quiz is Case Sensitive, so be careful while you answer.5.Hope you enjoy the game... ')
time.sleep(2)
print("Here is your first question...")
time.sleep(2)
C = ('1.Who Found Python?')
print(C)
print('Here are the Options: 1.Guido van Rossum; 2.James Gosling; 3.James Watt;4.Dr.Ambedkar')
C1 = input("Enter Answer:")
if C1 == 'Guido Van Rossum':
print('Correct! Cool...You got it')
else:
print('Wrong! Good Luck Next Time!')
D = ('1.When was Python found?')
print(D)
print('Here are the Options: 1.2021; 2.1912; 3.1989; 4.2013')
D1 = input("Enter Answer:")
if D1 == '1989':
print('Correct! Cool...You got it')
else:
print('Wrong! Good Luck Next Time!')
else:
print('Byee! We are Sad☹☹☹')
D = ('1.When was Python found?')
print(D)
print('Here are the Options: 1.2021; 2.1912; 3.1989; 4.2013')
D1 = input("Enter Answer:")
if D1 == '1989':
print('Correct! Cool...You got it')
else:
print('Wrong! Good Luck Next Time!')
5 Comments
This is a python quiz code. Please try using any python editor and Tell me your comment below.
ReplyDeleteGud Michel very gud!
ReplyDeleteGood
ReplyDeleteThank you!
ReplyDeleteThank You!!!
ReplyDeletePlease do Share this with all your Friends and Family.