Rainbow Deals - hours only!Up to 80% off on all courses and bundles.-Close
Displaying values
The print function
12. Joining strings and numbers
List basics


As you could see, Python knows the difference between strings (text) and numbers. The number 5 and the text (mind the apostrophes!) '5' are two different things. You can also use the plus sign (+) to join strings and numbers together, but you need to convert numbers to strings using function str():

current_age = 25
'I am ' + str(current_age) + ' years old.'

Note how we used str(current_age) to convert integer current_age into string. Without this conversion, the code would break.


Create variable endurance with a value of 5. Then, use the variable to show the following sentence:

I can walk for 5 hours!

Stuck? Here's a hint!

Use str(endurance).