practicepython.in
python exercises
171 exercises

Daily #35 · 2 November 2026

Adding an age Easy

What does this print?

age = 20
print("Age: " + age)
  1. Araises TypeError
  2. Braises ValueError
  3. CAge:20
  4. DAge: 20
Show the answer

A: raises TypeError

Why: + cannot join a string and a number; Python will not guess which one you meant to convert. Use "Age: " + str(age), or better, f"Age: {age}".

Play today’s puzzle →