# data[].attributes.body
import random
game_start = None

nama = input("Hello! What is your name: ")
user = int(input("\nHi " + nama +" .\nWelcome to our programme, " + nama + ".\nAre you ready to answer these questions?\nType 'Yes' or 'No' : "))

if user == "Yes":
#continue
#else:
#break

subject = int(input("\n\n1.  [Mathematic]  2. [Science]\nChoose your subject. : "))

if subject == 1:
print("\nThis question is so difficult. Don't use any programes to calculate.\nUse paper and pencil to answer this question!!!!!")

def difficultyLevel_EASY():
global x
print("\n\nQuestion 1\n\n")
print("(14+6x3)/64 = ")
print()
print("a. 3.5")
print("b. 2.5")
print("c. 1.5")
print("d. 0.5")
answer = input("\nMake your choice: ")
if answer == "d":
print("\nYour answer is correct!")
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 2\n\n")
print("50/100+1879-245.007 = ")
print()
print("a. 1634.493")
print("b. 2654.987")
print("c. 1643.493")
print("d. 2645.987")
answer = input("\nMake your choice: ")
if answer == "a":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 3\n\n")
print("654x65/8+7645 = ")
print()
print("a. 45789.75")
print("b. 12958.75")
print("c. 12596.75")
print("d. 34529.75")
answer = input("\nMake your choice: ")
if answer == "a":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 4\n\n")
print("104x7+5001/8 = ")
print()
print("a. 2353.125")
print("b. 1335.125")
print("c. 1353.125")
print("d. 2335.125")
answer = input("\nMake your choice: ")
if answer == "c":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 5\n\n")
print("7964/4+1798-1059 = ")
print()
print("a. 2370")
print("b. 2730")
print("c. 4370")
print("d. 4730")
answer = input("\nMake your choice: ")
if answer == "b":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 6\n\n")
print("8^6 = ")
print()
print("a. 263 144")
print("b. 272 144")
print("c. 262 144")
print("d. 273 144")
answer = input("Make your choice: ")
if answer =="c":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 7\n\n")
print("3/5 x 10/21 = ")
print()
print("a. 7/10")
print("b. 2/7")
print("c. 3/7")
print("d. 7/9")
answer = input("Make your choice: ")
if answer =="b":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 8\n\n")
print("23% x 87 = ")
print()
print("a. 20.21")
print("b. 19.01")
print("c. 21.01")
print("d. 20.01")
answer = input("Make your choice: ")
if answer =="d":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 9\n\n")
print("-67 x 34 = ")
print()
print("a. -3 378")
print("b. -3 278")
print("c. -2 278")
print("d. -2 378")
answer = input("Make your choice: ")
if answer =="c":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\nQuestion 10\n\n")
print("A book priced at RM 27.90. A pencil is RM 0.70. Ali bought two books and five pencils. How much does Ali have to pay?\n")
print("a. RM 59.40")
print("b. RM 59.30")
print("c. RM 60.30")
print("d. RM 60.40")
answer = input("Make your choice: ")
if answer =="b":
print("Your choice is correct!")
x = x + 1
else:
print("Your answer is wrong.\n")
startGame()

def difficultyLevel_HARD():
global x
print("\n\nQuestion 1\n\n")
print("87x78/25x98 = ")
print()
print("a. 42002.24")
print("b. 26001.12")
print("c. 42202.24")
print("d. 26601.12")
answer = input("\nMake your choice: ")
if answer == "d":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 2\n\n")
print("En. Amir bought a double storey terrace at RM 200 000 in year 2010.\nIn year 2017, En. Amir sold the house at RM 350 000.\nCalculate the percentage profit from the sales of En. Amir's house?")
print()
print("a. 25%")
print("b. 75%")
print("c. 50%")
print("d. 20%")
answer = input("\nMake your choice: ")
if answer == "b":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 3\n\n")
print("654x65/8+7645 = ")
print()
print("a. 45789.75")
print("b. 12958.75")
print("c. 12596.75")
print("d. 34529.75")
answer = input("\nMake your choice: ")
if answer == "a":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 4\n\n")
print("-7.9-3.2+(-1.2) =")
print()
print("a. 12.3")
print("b. 3.5")
print("c. -3.5")
print("d. -12.3")
answer = input("Make your choice: ")
if answer =="d":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 5\n\n")
print("Lela bought a Nokia hand phone for RM 1 600.\nAfter a certain time, she sold the hand phone for RM 1 200.\nCalculate the loss percentage.\n")
print("a. 25%")
print("b. 30%")
print("c. 35%")
print("d. 40%")
answer = input("Make your choice: ")
if answer =="a":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 6\n\n")
print("A farmer carries chickens, ducks and goats.\nThe number of ducks is 185 more than chickens.\nThe number of goats is 675 less than the number of ducks.\nWhat is the total number of animals that are reared by the farmer?\n")
print("a. 4213")
print("b. 4203")
print("c. 2366")
print("d. 3197")
answer = input("Make your choice: ")
if answer =="c":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 7\n\n")
print("Write 578 926 words.\n")
print("a. Five hundred seventy eight thousand six hundred twenty nine")
print("b. Five hundred eighty seven thousand nine hundred and twenty six")
print("c. Five hundred seventy nine thousand eight hundred and twenty nine")
print("d. Five hundred seventy eight thousand nine hundred and twenty six")
answer = input("Make your choice: ")
if answer =="d":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 8\n\n")
print("How many vertices, edges and surfaces of a hexagonal prism shape?\n")
print("a. Vertices = 10, Edges = 6, Surfaces = 12")
print("b. Vertices = 12, Edges = 10, Surfaces = 6")
print("c. Vertices = 12, Edges = 18, Surfaces = 8")
print("d. Vertices = 18, Edges = 8, Surfaces = 10")
answer = input("Make your choice: ")
if answer =="c":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 9\n\n")
print("What shape has 5 vertices, 8 edges and 5 surfaces?\n")
print("a. Triangular Based Pyramid")
print("b. Square Based Pyramid")
print("c. Pentagonal Prism")
print("d. Ovoid")
answer = input("Make your choice: ")
if answer =="b":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 10\n\n")
print("What shape has 4 vertices, 6 edges and 4 surfaces?\n")
print("a. Triangular Based Pyramid")
print("b. Square Based Pyramid")
print("c. Ellipsoid")
print("d. Rectangular Prism")
answer = input("Make your choice: ")
if answer =="a":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")
startGame()

if subject == 2:
print("\nThis question is too difficult.\nPlease answer all the question.")
print()
print()

def difficulty_level_easy():
global x
print("\n\nQuestion 1\n\n")
print("The following information shows steps to investigate competition between plants.\n J - Keep both containers, P and Q in the closet.\n K - Insert 5 green beans in container P and 20 green beans in container Q.\n L - After one week, notice the growth of green bean seedlings.\n M - Insert moist cotton into two containers, P and Q.\n Select the correct sequence of the steps.")
print()
print("a. M, K, J, L")
print("b. M, J, K, L")
print("c. J, K, L, M")
print("d. K, J, L, M")
answer = input("\nMake your choice: ")
if answer == "a":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 2\n\n")
print("Which of the following animals live alone?")
print("a. monkey")
print("b. elephant")
print("c. panda")
print("d. deer")
answer = input("\nMake your choice: ")
if answer == "c":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 3\n\n")
print("Which of the following is the most damaging logging problem?\n I Acid rain\n II Landslide\n III Floods\n IV Water pollution")
print()
print("a. I and II")
print("b. I and IV")
print("c. II and III")
print("d. III and IV")
answer = input("\nMake your choice: ")
if answer == "a":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 4\n\n")
print("Sumatran Rhino, Tapir and Turtle are endangered animal species.\nWhich of the following animals belongs to the same group?")
print()
print("a. Sparrow")
print("b. Pigeon")
print("c. Crow")
print("d. Hornbill")
answer = input("\nMake your choice: ")
if answer == "d":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 5\n\n")
print("Salleh took 30 seconds to ride a 360-mile bike.\nWhat is the speed of the bike?")
print()
print("a. 10 m/s")
print("b. 12 m/s")
print("c. 14m/s")
print("d. 15 m/s")
answer = input("\nMake your choice: ")
if answer == "b":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 6\n\n")
print("The direction will apply if")
print("a. if there is oil")
print("b. if there is water or air")
print("c. if there is hot water")
print("d. if there are papers around it")
answer = input("Make your choice: ")
if answer =="b":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 7\n\n")
print("This is a preservation method except")
print("a. pickling")
print("b. bottling")
print("c. canning")
print("d. heating")
answer = input("Make your choice: ")
if answer =="d":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 8\n\n")
print("The following is a way to prevent corrosion except")
print("a. paint the iron surface")
print("b. sweep oil or grease")
print("c. pour water over iron")
print("d. coating iron with plastic")
answer = input("Make your choice: ")
if answer =="c":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 9\n\n")
print("What is planet after Saturn")
print("a. Mars")
print("b. Neptune")
print("c. Uranus")
print("d. Jupiter")
answer = input("Make your choice: ")
if answer =="c":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 10\n\n")
print("What are the fire factors")
print("a. carbon dioxide")
print("b. oxygen")
print("c. petrol")
print("d. paper")
answer = input("Make your choice: ")
if answer =="":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")
startGame()

def difficulty_level_hard():
global x
print("\n\nQuestion 1\n\n")
print("What makes rainbow appeared?")
print()
print("a. refraction of light")
print("b. light separation")
print("c. light reflection")
print("d. the light moves straight")
answer = input("\nMake your choice: ")
if answer == "a":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 2\n\n")
print("In electronic devices what is the nickrom wire used?")
print()
print("a. toaster")
print("b. computer")
print("c. LED")
print("d. Air Conditional")
answer = input("\nMake your choice: ")
if answer == "a":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 3\n\n")
print("What materials are most used to make glass?")
print()
print("a. tree")
print("b. stond")
print("c. diamond")
print("d. sand")
answer = input("\nMake your choice: ")
if answer == "d":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 4\n\n")
print("what is the minimum value of paper brightness that can damage our eyes?")
print()
print("a. 50")
print("b. 60")
print("c. 70")
print("d. 80")
answer = input("\nMake your choice: ")
if answer == "c":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 5\n\n")
print("Why do we see different constellations at different times?")
print()
print("a. because the earth is circling around the sun")
print("b. Because the earth spins on its axis")
print("c. Because the earth spins on its axis")
print("d. Because the constellation is changing places")
answer = input("\nMake your choice: ")
if answer == "a":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 6\n\n")
print("Why is it easier to beat objects when in high places??")
print()
print("a. Because gravity is interesting")
print("b. Because the hot air goes up high")
print("c. Because more oxygen is in high places")
print("d. Because of high air pressure")
answer = input("\nMake your choice: ")
if answer == "b":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 7\n\n")
print("What causes the bombs to explode on the air without touching anything?")
print()
print("a. High air pressure")
print("b. Because it has expired")
print("c. Because it's broken")
print("d. High speed")
answer = input("\nMake your choice: ")
if answer == "a":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 8\n\n")
print("What are the factors that cause fire?")
print()
print("a. petrol")
print("b. paper")
print("c. carbon dioxide")
print("d. oxygen")
answer = input("\nMake your choice: ")
if answer == "d":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 9\n\n")
print("What does EMP mean??")
print()
print("a. Electric Mean Power")
print("b. Electro Magnetic Pulse")
print("c. Electro Magnetic Power")
print("d. Electric Mutant Power")
answer = input("\nMake your choice: ")
if answer == "b":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")

print("\n\nQuestion 10\n\n")
print("What happens when a negative charge meets a positive charge?")
print()
print("a. It will make electro magnetic")
print("b. Nothing")
print("c. It gets hotter")
print("d. It will be damaged")
answer = input("\nMake your choice: ")
if answer == "a":
print("\nYour answer is correct!")
x = x + 1
else:
print("\nYour answer is wrong.\n")
startGame()

def startGame():
global game_start
game_start = True
if subject == 1:
tahap = input("\nWelcome to the Test Your Mind Game.\nType 'Easy' or 'Hard' : ")
elif subject == 2:
tahap = input("\nWelcome to the Test Your Mind Game.\nType 'Simple' or 'Difficult' : ")

if tahap == 'Easy':
difficultyLevel_EASY()
elif tahap == 'Hard':
difficultyLevel_HARD()
elif tahap == 'Simple':
difficulty_level_easy()
elif tahap == 'Difficult':
difficulty_level_hard()
else:
print("\nPlease type it correctly.")
startGame()

def playAgain():
global game_start
game_start = True
play = input("Play again? Yes or No:")

if play=="Yes":
game_start()
print("Your score is : " + str(x/10*100) + "%")

elif play=="No":
game_start = False
print("Thanks for playing")
print("Your score is : " + str(x/10*100) + "%")

startGame()