Summer Deals - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Placeholders
Numbers
4. Integer placeholders
Date and time
Summary

## Instruction

Good job! Empty placeholders {} are good for any type of variable, but they do not provide any additional possibilities. Let's now move on to formatting numbers. We'll start with simple integers:

user_age = 25
print('You are {:d} years old.'.format(user_age))


Result: You are 25 years old.

The {:d} placeholder indicates that we simply want to print an integer value. In this case, we would get the same result with an empty pair of brackets {}. Note that the variable must be of a numerical type—e.g., if the variable you pass in to the formatter is a string, it will throw an exception.

## Exercise

What year is it now?
It is year {year} now.