Skip to content

Module 1: The Age Calculator

Concept: Variables, Input, and Type Casting.

We build a simple app that asks for your name and age, then calculates the exact year you will turn 100.

📺 The Build Session

🧠 Key Concepts

  • Input: input() always returns a string (text).
  • Casting: We use int() to convert text into numbers for math.
  • F-Strings: The clean way to combine text and variables: f"Hello {name}".

💻 The Code Blueprint

# 1. Ask for input
name = input("What is your name? ")
age = int(input("How old are you? "))  # Cast string to integer

# 2. The Logic
current_year = 2025
years_left = 100 - age
turn_100_year = current_year + years_left

# 3. Output
print(f"{name}, you will turn 100 in the year {turn_100_year}")