Really need some help.

I am working on a multiplication tutor program that is assigned to meet the following criteria:

  • Program asks the user how man problems they want to solve, if the user enters a value more than 10 the program interprets the number as an error and prompts the user for a different value.

  • Program generates a random multiplication problem with two variable numbers between 0 and 12.

  • Program prints the problem and prompts the user to answer it, if the user does not answer it correctly the program will tell the user if his answer was too high or too low and then ask a new question.

I found the following code on this website and thought I could modify it to work in the ways described above:

import random import math

game = int(input("How many problems do you want?\n")) num_1 = random.randint(1,10) num_2 = random.randint(1,10)

def main(game): random.seed() count = 0 correct = 0 #wrong != 0 #Took this variable out and replaced it with "if guess != answer" ('wrong' was originally part of an >else statement) because it was not working properly. while count < game: num_1 = random.randint(1,10) num_2 = random.randint(1,10) guess = int(input("What is " + str(num_1) + "x" + str(num_2) + ".")) answer = str(num_1*num_2) count += 1

   if guess == answer:
       correct += 1
       print1("Correct!")
   if guess != answer:
       print("Sorry, the answer is", answer, ".")

   if game > 1:
   result = correct * 100./game  

print("You got ", "%.1f"%result, "of the problems.")

main()

but.... I keep getting the following error and don't know what to do:

Traceback (most recent call last): File "C:\Users\Internet Fate\Desktop\game.py", line 30, in <module> main() TypeError: main() missing 1 required positional argument: 'game'

I have been trying to figure out what the issue is for over an hour now and I am starting to get stressed. In addition to this I have no idea how to get the program to only accept an input from 1-10 for the number of times the game is played (referring to criteria point number one). How to get the program to tell the user that there answer was too high or too low and then have it give them a new problem (referring to point three). And no idea how to repeat this process the designated number of times and then restart.

I am extremely sorry in advance for how poorly written this all is I am just stressing out trying to learn python. Thank you for helping.

/r/learnpython Thread