Project 7: Restaurant Menu
Python Challenge
Builds on these lessons
Step 1 of 3
Project
Type Hints on a Menu Function
Write def format_price(cents: int) -> str:, annotating the parameter and return types. Type hints don't change how Python runs the code at all — they're documentation a type checker (like mypy, later in this track) and your editor can both read.
🎯 Your Task
Please add the exact code shown in the light gray box below to your editor.Do not delete your previous code, just insert these new lines in the correct place!
def format_price(cents: int) -> str:
return f"${cents / 100:.2f}"
print(format_price(1400))