0

Write a program that plays a simple maths game. The program should read two integer numbers from the user and then ask the user to enter the product of the two numbers. If the product is correct, the program should display "Correct", otherwise it should display "Incorrect". The program prompts should be: Enter the first number: Enter the second number: Enter [first_number] * [second_number] = Notes: The output must be in the format shown in the example, including the format of the prompt, and all spaces and punctuation. All numbers should be displayed as integer values.

How do I get the input prompt values into the third input prompt?

first_number = input("Enter the first number: ")
second_number = input("Enter the second number: ")
product = input("Enter", first_number * second_number, "= ")

if first_number * second_number == product :
    print("Correct")
else:
    print("Incorrect") 
Lava_lakes
  • 13
  • 1
  • 3
  • Remember that `input()` returns a string and not an integer even though you write it. You need to specifically convert it. – Cow Jul 28 '22 at 11:01
  • So I fixed the code to convert the string to int. but it still doesn't help my code. I don't know how to get the value that's input into the first_number and second_number prompts inserted into the product input prompt – Lava_lakes Jul 28 '22 at 11:05
  • Check the link: https://stackoverflow.com/questions/2960772/how-do-i-put-a-variable-s-value-inside-a-string – Cow Jul 28 '22 at 11:07

0 Answers0