mathquiz.py
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,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…
Reference in New Issue