Create a dictionary of at least 20 Python terms as the keys and the values will be a short definition. You can find terms anywhere you wish Your program should generate 25 quizzes using a random selection of terms with 4 answer options (A, B, C and D). Set the os.chdir() command to reflect where you will be saving the files on your computer.
name = input ("enter your name: ")
print ("hello", name, "welcome to the quiz world")
score=0
for i in questions:
print ()
print (i)
flagl = input ("Do you want to skip this question (yes/no): ")
if flag1=="yes":
continue
ans = input ("enter the answer (a/b/c/d) :")
if ans==questions[i]:
print ("correct answer, you got 1 point")
score = score+1
print ("current score is:", score)
else:
print("wrong answer, you lost 1 point")
score=score-1
print ("current score is:", score)
flag2= input ("Do you want to quit (yes/no) :")
if flag2 == "yes":
break
print("Final score is: ", score)
Comments
Leave a comment