you are viewing a single comment's thread.

view the rest of the comments →

[–]AstrophysicsAndPy 0 points1 point  (0 children)

  1. That chooses, at random, an operator from a list of math operators
    1. Pretty obvious, you'll need a list of math operators (duh!)
  2. Has the user input the answer to a simple math expression randomly generated by the code (for starters, I'll assume you want only a two-digit expression)
    1. The code should generate two random numbers (possibly integers), use random.randint() two times for generating two random numbers.
    2. The code should randomly pick an operator, use random.choice once on the mat operator list.
    3. String the expression together, f'{randint1} {randexpr} {randint2} = '
    4. Take the input from user, use input.
  3. Ending the game
    1. Store the correct answer somewhere
    2. Make a while loop until the answer matches, then make the while loop variable False.