Why these codes are not working

print product = (“5 X 5”)

print product = “5 * 5”

print product = ‘5 + 5’

print product = “5 + 5”

the link

https://www.codecademy.com/courses/learn-python/lessons/python-syntax/exercises/arithmetic?action=resume_content_item

1 Like

That code will output,

5 X 5
5 * 5
5 + 5
5 + 5

since they are all strings.

print (5 X 5)

will raise an error. X is not an operator so the error will likely be, unexpected identifier.

print (5 * 5)

will output, 25, and the other two, if not written as strings, but rather as expressions, will output, 10.

1 Like