Exercises
Concatenation
3 tasks. Write the code, press Check, and the page runs it against a real Python interpreter.
Exercise 1Passed
This raises TypeError. Fix it so it prints Age: 36.
Python
age = 36
print("Age: " + age)Convert the number to text with str(), or use an f-string.
age = 36
print(f"Age: {age}")Exercise 2Passed
Print a line of exactly 20 dashes.
Python
# print 20 dashes
Multiplying a string repeats it.
print("-" * 20)Exercise 3Passed
A comma is missing, so the list has two items instead of three. Fix it.
Python
names = ["Ada", "Grace" "Katherine"]
print(len(names))Adjacent string literals join themselves.
names = ["Ada", "Grace", "Katherine"]
print(len(names))