mathquiz.py

August-report
Spencerscooper 1 year ago
parent 4e48f04744
commit 6ccb592191

@ -1,7 +1,12 @@
from random import randint question1 = "What is science ?"
question2 = "What is UFW ?"
question3 = "What is HTML "
question4 = "What is CSS ?"
answer1 = "Uncomtrollable Fireware"
num1 = randint(1, 10) questions = [question1,question2,question3,question4]
num2 = randint(1, 10) for question in questions:
question = "What is " + str(num1) + " times " + str(num2) + "? " if questions == :
answer = int(input(question))
print(question)

@ -1,3 +1,5 @@
import time
from gasp import * from gasp import *
from random import randint from random import randint
@ -37,3 +39,6 @@ end_graphic()
randint(10,15) randint(10,15)
time.strftime("%A, %d %B %Y, at %I:%M%p", time.localtime(time.time()))
print(time)

@ -1,33 +1,79 @@
from random import randint from random import randint
print("What is 7 times 2?") value1 = randint(1,10)
value1 = int(input ("first value")) value2 = randint(1,10)
value2 = int(input("second value"))
if value1 * value2 == 14:
print("This is your answer " + str (value1*value2))
else:
print("Try again!!")
#Challenge 1
answer1 = value1 * value2
print("What is " + str(value1) + " time " + str(value2) + "\n",answer1)
#Challenge 2 #Challenge 2
print("Enter any two valid number to know it sum") answer2 = value1 + value2
number1 = int(input("first number")) print("What is " + str(value1) + " plus " + str(value2) + "\n",answer2)
number2 = int(input("second number"))
print("Your answer is " + str(number1+number2))
#Challenge 3 #Challenge 3
print("What is 7 time 3") print("What is", value1, "times" , value2)
numberOne = int(input("Type in your answer now")) user_input = int(input("type your answer "))
if numberOne == 21:
print(numberOne) if value1 * value2 == user_input:
print(user_input , "Is correct")
elif value1 * value2 != user_input:
print(user_input , "Is not correct")
#Challlenge 4
repeatNumber = randint(5,50)
for numbers in range(5):
print("your output is ",numbers)
#Challenges 5:
print("What is", value1, "times" , value2)
print("What is", value1, "times" , value2)
user_input = int(input("type your answer "))
if value1 * value2 == user_input:
print(user_input , "Is correct")
elif value1 * value2 != user_input:
print(user_input , "Is not correct")
print("The correct answer is ",value1*value2)
#Challenges 6 coming soon
#Challenge 4
RandomNumber = randint(10,20)
print(RandomNumber)
print(RandomNumber)
print(RandomNumber)
print(RandomNumber)
print(RandomNumber)

Loading…
Cancel
Save