I have now updated my script but i dont know what im doing wrong.. i think it is something wrong with the if or input.. if anyone wants to try it out and give me a little feedback i would appreciate that :P
my goal is to print out Random Question, and when i answer correct on that it prints out Correct!, if im wrong it should print out False!
my goal is to print out Random Question, and when i answer correct on that it prints out Correct!, if im wrong it should print out False!
import random #variables for questions fr1=("Fråga 1?") fr2=("Fråga 2?") fr3=("Fråga 3?") fr4=("Fråga 4?") fr5=("Fråga 5?") fr6=("Fråga 6?") fr7=("Fråga 7?") fr8=("Fråga 8?") fr9=("Fråga 9?") fr10=("Fråga 10?") #variables for answers sv1=("Svar 1") sv2=("Svar 2") sv3=("Svar 3") sv4=("Svar 4") sv5=("Svar 5") sv6=("Svar 6") sv7=("Svar 7") sv8=("Svar 8") sv9=("Svar 9") sv10=("Svar 10") #variables for questions fr = [fr1, fr2, fr3, fr4, fr5, fr6, fr7, fr8, fr9, fr10] sv = [sv1, sv2, sv3, sv4, sv5, sv6, sv7, sv8, sv9, sv10] #KEYS fr1=sv1 fr2=sv2 fr3=sv3 fr4=sv4 fr5=sv5 fr6=sv6 fr7=sv7 fr8=sv8 fr9=sv9 fr10=sv10 #variables for random.choice that prints out randomquestions from the "fr" list slumpFråga = random.choice(fr) svar = 0 print(slumpFråga) #random question input() int() if sv==slumpFråga: #if-sats answer = randomquestion print ("Correct!") else: print ("False!")