Answers for "how to make a random question generator in python"

1

random question generator python

import random
# from random import choice
questions = ['Question1', 'Question2', 'Question3']
random_item = random.choice(questions)

print (random_item)
Posted by: Guest on September-08-2020
0

how to make a random question generator in python

num1 = random.randint(1, 10)

num2 = random.randint(1, 10)

answer = int(input(f"What is {num1} + {num2}?\n"))

if answer == (num1 + num2):
    print("Correct")

else:
    print("Wrong")
Posted by: Guest on October-06-2021

Code answers related to "how to make a random question generator in python"

Python Answers by Framework

Browse Popular Code Answers by Language