Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What will happen if you try to run print('My age is ' + 10)?
Remember the data types being mixed.
How can you fix the above error?
Think of how to change the number to text.
What happens if you try to print a string concatenated with an integer without conversion?
Which error is related to mixed types?
True or False: Using str() will convert an integer to a string.
What function do we use to change types?
Write a program that prints your full name and age, ensuring no TypeError occurs.
Don’t forget to convert age!
Create a print statement that reads: 'The temperature today is degrees.' and uses a variable for the temperature without raising an error.
You must convert temperature to a string!
5 more questions in this section. Enroll free to practise them all.
Enroll free