Fixing code that prints a name and an age

Code review · Medium · §2.4, §2.5, §2.6 Type conversion

This code tries to print a name, its first letter, and an age. It has four mistakes, so it stops with an error. Fix it so that it prints Kim(K): age 19. The age is the difference in years and ignores birthdays.

Code to fix

name = "Kim"
birth = "2007"
int(birth)
first = name[1]
print("{name}({first}): age "
      + (2026 - birth))

Solve this problem in your browser

Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.