Simple math exam

Example Output
What is the first number? 10
What is the second number? 5
10 + 5 = 15
10 - 5 = 5
10 * 5 = 50
10 / 5 = 2
is this code is good? and can you give me many solution to this exam
n = int(input(“What is your first number?:”))
n2 = int(input(“What is your second number?:”))

print(f’{n}* {n2} =’,n*n2)

print(f’{n} / {n2} =’, n/n2)

print(f’{n}- {n2} =’, n-n2)

print(f’{n}+ {n2} =’, n+n2)

I’m new, so I’m not the most reputable one, but I’m gonna need a bit more information in order to help :slight_smile: sorry!

1 Like

Yes it looks good, but remember if you want to reproduce the Example Output to reorder you print statement in the correct order.
When you are using f-string in the print statement you dont need a comma and you can incorporate that within the f-string for example:

print(f"{n} + {n2} = {n+n2}")

Hope this helps!