import random
q = random.randint(10, 100)
w = random.randint(10, 100)
e = (q, " * ", w)
r = int(input(e))
This outputs (i.e):
>>> (60, ' * ', 24)
I tried following this post but I faced an error.
I want output to atleast look like:
>>> (60 * 24)
What I tried was doing
import random
q = random.randint(10, 100)
w = random.randint(10, 100)
**e = (q + " * " + w)**
r = int(input(e))
Which gave me the error.
A great way to do this is with f-strings
e = f"{q} * {w}"
You just need to start your string with an f, then include any variables in curly braces {}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments