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)
num2 = randint(1, 10)
question = "What is " + str(num1) + " times " + str(num2) + "? "
answer = int(input(question))
questions = [question1,question2,question3,question4]
for question in questions:
if questions == :
print(question)

@ -1,3 +1,5 @@
import time
from gasp import *
from random import randint
@ -37,3 +39,6 @@ end_graphic()
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
print("What is 7 times 2?")
value1 = int(input ("first value"))
value2 = int(input("second value"))
if value1 * value2 == 14:
print("This is your answer " + str (value1*value2))
else:
print("Try again!!")
value1 = randint(1,10)
value2 = randint(1,10)
#Challenge 1
answer1 = value1 * value2
print("What is " + str(value1) + " time " + str(value2) + "\n",answer1)
#Challenge 2
print("Enter any two valid number to know it sum")
number1 = int(input("first number"))
number2 = int(input("second number"))
print("Your answer is " + str(number1+number2))
answer2 = value1 + value2
print("What is " + str(value1) + " plus " + str(value2) + "\n",answer2)
#Challenge 3
print("What is 7 time 3")
numberOne = int(input("Type in your answer now"))
if numberOne == 21:
print(numberOne)
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")
#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