When I'm coding, I choose a random value from a list and print it alongside two numbers to make a sum. However, the value from the list still shows the quotation marks and I don't understand why. The code is:
import random
level = input('Please choose either easy, medium or hard')
if level == 'easy':
num1 = random.randint(1,5)
num2 = random.randint(1,5)
#Chooses a random operator from the list
op = random.choice(['+', '-', '*'])
#Arranges it so the larger number is printed first
if num1 > num2:
sum1 = (num1, op, num2)
else:
sum1 = (num2, op, num1)
#Prints the two numbers and the random operator
print(sum1)
I try running this code and the result I am given is:
(4, '*', 3)
When I want it to appear as:
4*3
Those numbers are randomly generated also but work fine. Does anyone know how to solve this problem?