import random #where defs things go def quiz_compare(user_answer, answer): #checks whether the user answer is correct # if computer and user choice are the same if user_answer == answer: question_result = 'Correct' # if user answer is different else: question_result = 'Wrong' return question_result wut_topic_1_question = random.randrange(0,5) wut_answer_1 = wut_topic_1_question wut_topic_2_question = random.randrange(0,5) wut_answer_2 = wut_topic_2_question wut_topic_3_question = random.randrange(0,5) wut_answer_3 = wut_topic_3_question wut_topic_4_question = random.randrange(0,5) wut_answer_4 = wut_topic_4_question wut_topic_5_question = random.randrange(0,5) wut_answer_5 = wut_topic_5_question #introduce title of quiz #ask if user wants to see instructions #if y give instructions and continue, if no continue #storing what the questions are question_1 = 'what colour is kris in the dark world? ' question_2 = 'Does susie have a tail? ' question_3 = "what is kris's last name? " question_4 = "what is the queens full serial name? " question_5 = "how many spikes does susie have on her arm bands? " answer_1 = "cyan" answer_2 = "yes" answer_3 = "dreemurr" answer_4 = "579y5y393784534342342" answer_5 = "3" question_6 = 'what is noelles last name? ' question_7 = 'what colour are birdly glasses in the dark world? ' question_8 = 'how many img.friend interactions have there been? ' question_9 = 'who is the roaring knight?' question_10 ='What job did gerson have in the light world? ' answer_6 = 'beans' answer_7 = 'beans' answer_8 = 'beans' answer_9 = 'beans' answer_10 = 'beans' question_11 = 'what colour is kris in the dark world? ' question_12 = 'Does susie have a tail? ' question_13 = "what is kris's last name? " question_14 = "what is the queens full serial name? " question_15 = "how many spikes does susie have on her arm bands? " answer_11 = "cyan" answer_12 = "yes" answer_13 = "dreemurr" answer_14 = "579y5y393784534342342" answer_15 = "3" question_16 = '? ' question_17 = 'dfbeans? ' question_18 = 'sbeans? ' question_19 = 'dffdbeans?' question_20 ='gggbeans? ' answer_16 = 'beans' answer_17 = 'beans' answer_18 = 'beans' answer_19 = 'beans' answer_20 = 'beans' question_21 = 'what colour is kris in the dark world? ' question_22 = 'Does susie have a tail? ' question_23 = "what is kris's last name? " question_24 = "what is the queens full serial name? " question_25 = "how many spikes does susie have on her arm bands? " answer_21 = "cyan" answer_22 = "yes" answer_23 = "dreemurr" answer_24 = "579y5y393784534342342" answer_25 = "3" #storing the topics and questions topic_1 = [question_1,question_2,question_3,question_4,question_5] answers_1 = [answer_1, answer_2, answer_3, answer_4, answer_5] topic_2 = [question_6,question_7,question_8,question_9,question_10] answers_2 = [answer_6, answer_7, answer_8, answer_9, answer_10] topic_3 = [question_11,question_12,question_13,question_14,question_15] answers_3 = [answer_11, answer_12, answer_13, answer_14, answer_15] topic_4 = [question_16,question_17,question_18,question_19,question_20] answers_4 = [answer_16, answer_17, answer_18, answer_19, answer_20] topic_5 = [question_21,question_22,question_23,question_24,question_25] answers_5 = [answer_21, answer_22, answer_23, answer_24, answer_25] #picking a question question1 = "pick one randomly from topic1" # check whether user answer matches correct answer # inform user whether they got it right or wrong #ask next question #when all questions have been asked and answered caluacte how much they # got out of 5 #tell user their score #ask if they want to end or try it again #if again repeat from picking a question #if end end code #main code/ testing #if user_answer == answer: #print(f'Answer:{answer}') # print("you got it right") #if user_answer != answer: # print(f'Answer:{answer}') # print("you got it wrong") # checks users enter y or n user_answer = input(topic_1[wut_topic_1_question]).lower() answer = answers_1[wut_answer_1] result = quiz_compare(user_answer, answer) print(f'{result}, Your answer: {user_answer}, Answer: {answer}') user_answer = input(topic_2[wut_topic_2_question]).lower() answer = answers_2[wut_answer_2] result = quiz_compare(user_answer, answer) print(f'{result}, Your answer: {user_answer} Answer: {answer}') user_answer = input(topic_3[wut_topic_3_question]).lower() answer = answers_3[wut_answer_3] result = quiz_compare(user_answer, answer) print(f'{result}, Your answer: {user_answer} Answer: {answer}') user_answer = input(topic_4[wut_topic_4_question]).lower() answer = answers_4[wut_answer_4] result = quiz_compare(user_answer, answer) print(f'{result}, Your answer: {user_answer} Answer: {answer}') user_answer = input(topic_5[wut_topic_5_question]).lower() answer = answers_5[wut_answer_5] result = quiz_compare(user_answer, answer) print(f'{result}, Your answer: {user_answer} Answer: {answer}')