How to make a quiz in python part 2! Streaks! #coding #python #trending #shrots #quiz #copyandpaste

preview_player
Показать описание
I hope you enjoyed this video. Please like and subscribe as it motivates me to make more content like this. Please comment if you want an in-depth explanation on hoe to make a quiz,
Рекомендации по теме
Комментарии
Автор

150 views and 5 likes for part 3. Print correct and incorrect answers.

Please comment if you want an in-depth explanation about how to make a quiz. Thank you.

score = 0
wrong = 0
streak = 0
nonstreak = streak = 0
points = 0

ans1=input("who is the president of America? ")
if ans1 == "Joe Biden":
print("Correct answer!")
score=score+1
streak=streak+1
points = points+100
elif ans1 != "Joe Biden":
print("Wrong answer!")
wrong = wrong+1
nonstreak

ans2=input("1+1 ")
if ans2 == '2':
print("Correct answer!")
score=score+1
streak = streak+1
points=points+100
nonstreak
elif ans2 != '2':
print("Wrong answer!")
wrong = wrong+1
nonstreak

ans4=input("1+2 ")
if ans4 == '3':
print("Correct answer!")
score=score+1
streak=streak+1
points=points+100
elif ans4 != '3':
print("Wrong answer!")
wrong = wrong+1
nonstreak

ans3=input("1+5 ")
if (streak>2):
print('BONUS POINTS!!!')
score=score+1
points=points+200
elif ans3 == '6':
print("Correct answer!")
score=score+1
elif ans3 != '6':
print("Wrong answer!")
wrong = wrong+1

print(score)

Python_If-Else
visit shbcf.ru