Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
Show the line 12 + 7 = 19. The answer must be worked out by Python.
Text inside quotation marks, then the sum outside.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, compare your working with the solution.
Plan. Put the text 12 + 7 = first, then the sum 12 + 7 without quotation marks.
print("12 + 7 =", 12 + 7)
The comma puts one space between the two pieces, so the line is 12 + 7 = 19.
Check. Change the numbers in the sum part only. The answer changes, and the text stays.
Log in to join the discussion.
Loading…