“Jak zrobić losowy generator pytań w Python” Kod odpowiedzi

Python generator pytań

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

print (random_item)
Vivacious Vole

Jak zrobić losowy generator pytań w 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")
Blue Bear

Odpowiedzi podobne do “Jak zrobić losowy generator pytań w Python”

Pytania podobne do “Jak zrobić losowy generator pytań w Python”

Więcej pokrewnych odpowiedzi na “Jak zrobić losowy generator pytań w Python” w Python

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu