Lesson 3 of 3 · Python for AI

Python Basics: Variables, Types, and Print

reading35 min

The Story of Marcus's First Line of Code

Marcus Reeves had been a commercial real estate broker for fourteen years. He was good at his job -- he could walk into a building and estimate its value within five percent, negotiate a lease that made both sides feel like winners, and read a market trend months before his competitors noticed. What he could not do, or so he believed, was write code.

The idea of learning Python had been nagging at him for months. He kept reading about AI tools that could analyze property listings, predict rental yields, and automate the tedious market reports he spent every Sunday afternoon preparing. But every tutorial he found seemed to assume you already knew what a "variable" was, or that terms like "string" and "integer" were self-explanatory. They were not self-explanatory. Not to Marcus.

On a rainy Tuesday evening, after his third attempt at an online Python course that began with the sentence "Let's explore object-oriented paradigms," Marcus almost quit for good. He closed his laptop, poured a glass of bourbon, and stared at the ceiling.

Then he opened the laptop one more time. He opened the Python environment he had installed earlier that week -- just the simple IDLE editor that comes with Python -- and typed exactly five words:

Concept Card
Python
print("Hello, Marcus")

He pressed Enter. And there, on the screen, in plain text, the computer said it back to him:

Hello, Marcus

Marcus stared at the output. It was absurdly simple. He had typed an instruction, and the computer had followed it. No ambiguity. No negotiation. No misinterpretation. He had told the machine to print his name, and it did exactly that.

He typed another line:

Python
print("The rent is $4,500 per month")
The rent is $4,500 per month

Then another:

Python
monthly_rent = 4500
annual_rent = monthly_rent * 12
print(f"Annual rent: ${annual_rent}")
Annual rent: $54000

Marcus sat up in his chair. He had just created a variable, performed a calculation, and displayed the result -- all in three lines of code. No one had given him permission. No one had certified him. He had just... done it.

That moment -- the moment you see something you wrote produce a result on screen -- is one of the most powerful experiences in learning to code. It is the moment the computer stops being a mysterious black box and starts becoming a tool you control.

This lesson will give you that same moment. By the end, you will understand how Python stores information, how it thinks about different types of data, and how to make it talk to you. You will also build something real: a simple AI cost calculator that computes how much money an API call will cost based on token count and pricing.

Concept Card

Let's start with the single most important concept in all of programming.


Variables: Giving Names to Things

What Is a Variable?

A variable is a name you assign to a piece of data so you can use it later. That's it. No deeper mystery. Think of it like a label on a file folder -- the label tells you what's inside, and you can refer to the folder by its label instead of describing its contents every time.

In Python, you create a variable with a single equals sign:

Python
city = "Denver"

This line says: "Create a label called city and store the text Denver inside it." From this point forward, anywhere you write city in your code, Python will substitute the value "Denver".

Python
city = "Denver"
print(city)
Denver

Notice that when we print city, we do not put quotes around it. If we did, Python would print the literal word "city" instead of the value stored inside the variable:

Python
print("city")    # Prints the literal text: city
print(city)      # Prints the stored value: Denver

This distinction -- between the name of the variable and the value inside it -- is one of the first things every programmer must internalize.

Tip

Use Python Basics: Variables, Types, and Print in a low-risk branch or scratch project first. That keeps the lesson concrete without making your first attempt carry production pressure.

Naming Rules and Conventions

Python has a few rules about variable names:

Python
# Valid variable names
first_name = "Marcus"
monthly_rent = 4500
is_available = True
property_2024 = "Downtown Tower"

# Invalid variable names -- these will cause errors
# 2024_property = "Tower"    # Cannot start with a number
# my-name = "Marcus"         # Hyphens not allowed (use underscores)
# class = "Premium"          # "class" is a reserved Python keyword

The Python convention is to use snake_case -- lowercase words separated by underscores. You will see this everywhere in professional Python code, and in every AI library you will use later in this track.

Naming Variables Well

Good variable names are like good file labels -- they tell you exactly what's inside without needing to open the folder. Compare these:

Python
# Bad -- you have no idea what these mean
x = 4500
y = 12
z = x * y

# Good -- the code explains itself
monthly_rent = 4500
months_per_year = 12
annual_rent = monthly_rent * months_per_year

Take the extra two seconds to write a clear name. Your future self will thank you when you reopen this code in three months.

Reassigning Variables

Variables are not permanent. You can change what they hold at any time:

Python
price = 100
print(price)      # 100

price = 200
print(price)      # 200

price = price + 50
print(price)      # 250

That last line might look strange if you think of = as "equals" in the mathematical sense. In Python, = means assignment, not equality. The line price = price + 50 says: "Take the current value of price (200), add 50, and store the result (250) back into price."


Data Types: How Python Thinks About Information

Every value in Python has a type -- a category that determines what you can do with it. Think of it like the difference between a phone number and a street address. They are both pieces of information, but you would not try to navigate to a phone number.

Strings -- Text

Strings are sequences of characters wrapped in quotes. You can use either single quotes or double quotes -- Python treats them identically:

Python
name = "Marcus Reeves"
city = 'Denver'
greeting = "Hello, world!"

Strings are the most important data type for AI work, because prompts and responses are strings. Everything you send to an AI model is text. Everything that comes back is text.

Tip

If Python Basics: Variables, Types, and Print becomes part of a recurring workflow, document the exact trigger, boundary, and verification step now. Future speed comes from clarity, not from memory.

Python
# A prompt is just a string
prompt = "Analyze this property listing and identify the three strongest selling points."

# A response from an AI model would also be a string
response = "1. Prime downtown location..."

Multi-line Strings

For longer text -- like AI prompts -- use triple quotes:

Python
system_prompt = """You are a commercial real estate analyst.
When given a property description, evaluate:
1. Location quality
2. Market value estimate
3. Investment risk level
Always respond in a professional tone."""

Triple-quoted strings preserve line breaks exactly as you write them. You will use these constantly when building prompts for AI models.

Integers -- Whole Numbers

Integers are numbers without decimal points:

Python
square_footage = 2400
num_units = 16
year_built = 1987
floor_count = 4

You can do all the arithmetic you would expect:

Python
total_sqft = square_footage * num_units
print(total_sqft)    # 38400

building_age = 2026 - year_built
print(building_age)  # 39

Floats -- Decimal Numbers

Floats are numbers with decimal points:

Python
price_per_sqft = 42.75
cap_rate = 0.065
temperature = 0.7       # This is an AI model setting you will use later
Float Precision Quirk

Computers sometimes produce tiny rounding errors with floats. This is normal and rarely matters in practice, but it can surprise beginners:

Python
print(0.1 + 0.2)    # 0.30000000000000004 (not exactly 0.3)

For most AI work, this is irrelevant. If you need exact decimal math (for financial calculations, for example), Python has a Decimal module. For now, just be aware this quirk exists.

Booleans -- True or False

Booleans represent yes/no, on/off, true/false values:

Python
is_vacant = True
has_parking = False
is_published = True

Note the capital T and F -- True and False are Python keywords. Writing true (lowercase) will cause an error.

Booleans become essential when you start making decisions in your code (which we will cover in the next chapter on conditionals). For now, just know they exist and they only have two possible values.

Checking Types

If you are ever unsure what type a value is, use the type() function:

Python
name = "Marcus"
rent = 4500
rate = 0.065
available = True

print(type(name))       # <class 'str'>
print(type(rent))       # <class 'int'>
print(type(rate))       # <class 'float'>
print(type(available))  # <class 'bool'>

The print() Function: Making Python Talk

You have already been using print() -- it is how you see output from your code. But there is more to it than just printing a single value.

Printing Multiple Values

You can pass multiple items to print(), separated by commas. Python will automatically add a space between them:

Measure the Python Basics: Variables, Types, and Print Tradeoff

  1. Choose one task you repeat often.
  2. Run it with the model, cost, or performance setting discussed in this lesson.
  3. Record latency, quality, and cost so you can choose intentionally next time.
Python
name = "Marcus"
age = 38
print("Name:", name, "| Age:", age)
Name: Marcus | Age: 38

f-strings: The Professional Way to Format Output

f-strings (formatted string literals) are the modern, readable way to embed variables inside text. Put an f before the opening quote, then use curly braces {} around any variable or expression:

Python
property_name = "Riverside Tower"
units = 24
vacancy_rate = 0.08

print(f"Property: {property_name}")
print(f"Total units: {units}")
print(f"Vacancy rate: {vacancy_rate * 100}%")
Property: Riverside Tower
Total units: 24
Vacancy rate: 8.0%

You can put any Python expression inside the curly braces -- not just variable names:

Python
price = 425000
print(f"Half the price: ${price / 2}")
print(f"Price in millions: ${price / 1_000_000:.2f}M")
Half the price: $212500.0
Price in millions: $0.43M

The :.2f part is a format specifier -- it means "show as a float with 2 decimal places." You will find these useful when displaying prices and percentages.

f-string Format Specifiers You Will Actually Use
Python
value = 1234567.891

print(f"{value:,.2f}")    # 1,234,567.89  (commas + 2 decimals)
print(f"{value:.0f}")     # 1234568       (no decimals, rounded)
print(f"{0.0847:.1%}")    # 8.5%          (as percentage, 1 decimal)
print(f"{42:>10}")        #         42    (right-aligned, 10 chars wide)

You do not need to memorize these. Bookmark this callout and come back when you need one.

Using print() for Debugging

One of the most practical uses of print() is debugging -- figuring out what is going wrong in your code. When something produces an unexpected result, add print() statements to see what Python is actually doing:

Python
# Something is wrong with our rent calculation...
monthly_rent = "4500"       # Oops -- this is a string, not a number!
months = 12

# Debugging: let us see what we are working with
print(f"monthly_rent = {monthly_rent}, type = {type(monthly_rent)}")
print(f"months = {months}, type = {type(months)}")

# This would crash: annual = monthly_rent * months
# TypeError: can't multiply sequence by non-int of type 'str'

The print() statement reveals the bug immediately -- monthly_rent is a string "4500", not the number 4500. The quotes made all the difference.


Type Conversion: Translating Between Types

Sometimes you have data in one type and need it in another. Python provides built-in functions for converting between types:

Python
# String to integer
user_input = "4500"
rent = int(user_input)
print(rent + 500)           # 5000 (math works now)

# String to float
rate_text = "6.5"
cap_rate = float(rate_text)
print(cap_rate / 100)       # 0.065

# Number to string
price = 425000
price_label = str(price)
print("Price: $" + price_label)   # Price: $425000

# Float to integer (truncates, does not round!)
temperature = 72.9
whole_temp = int(temperature)
print(whole_temp)           # 72 (not 73!)
int() Truncates, It Does Not Round

When converting a float to an integer with int(), Python simply chops off the decimal -- it does not round. If you want proper rounding, use the round() function:

Python
print(int(3.9))       # 3 (truncated)
print(round(3.9))     # 4 (rounded)
print(round(3.14159, 2))  # 3.14 (rounded to 2 decimal places)

Why Type Conversion Matters for AI Work

When you work with AI APIs, data constantly moves between types. An API might return a token count as a string inside a JSON response. You need to convert it to an integer before you can do math with it. A price might arrive as a float that you need to display as a formatted string. Understanding type conversion is not abstract -- it is a daily practical skill.

Optimize One Repeated Task

  1. Take one expensive or slow Claude workflow from your week.
  2. Apply the optimization idea from this lesson to it once.
  3. Keep the change only if quality stayed acceptable while speed or cost improved.
Python
# Simulating data from an AI API response
response_data = {
    "tokens_used": "1247",
    "cost_per_token": "0.00003",
    "model": "claude-sonnet"
}

# Convert strings to numbers for calculation
tokens = int(response_data["tokens_used"])
cost_per_token = float(response_data["cost_per_token"])
total_cost = tokens * cost_per_token

print(f"Model: {response_data['model']}")
print(f"Tokens: {tokens:,}")
print(f"Cost: ${total_cost:.4f}")
Model: claude-sonnet
Tokens: 1,247
Cost: $0.0374

Comments: Explaining Your Code

Comments are notes you write for humans -- Python ignores them completely. Use the # symbol:

Python
# Calculate annual operating expenses
maintenance = 12000        # Per unit per year
insurance = 85000          # Building-wide annual premium
taxes = 142000             # Property taxes

total_expenses = (maintenance * 24) + insurance + taxes
# 24 units in the building

When to Comment (and When Not To)

Good comments explain why you did something, not what the code does. If your code is well-named, the "what" should be obvious:

Python
# Bad comment -- just restating what the code says
x = 4500  # set x to 4500

# Good comment -- explaining the business logic
monthly_rent = 4500  # Market rate for 2BR in downtown Denver (Q1 2026)

# Good comment -- explaining a non-obvious decision
temperature = 0.3  # Lower temperature = more consistent output for data extraction

For multi-line explanations, you can stack comments or use a docstring:

Python
# Calculate the capitalization rate for this property.
# Cap rate = Net Operating Income / Purchase Price
# A higher cap rate generally means higher risk but higher potential return.
cap_rate = net_operating_income / purchase_price

Arithmetic Operations

Python supports all the math operations you would expect, plus a few useful extras:

Python
a = 20
b = 6

print(a + b)      # 26  (addition)
print(a - b)      # 14  (subtraction)
print(a * b)      # 120 (multiplication)
print(a / b)      # 3.3333...  (division -- always returns a float)
print(a // b)     # 3   (floor division -- rounds down to integer)
print(a % b)      # 2   (modulo -- the remainder after division)
print(a ** b)     # 64000000  (exponentiation -- 20 to the power of 6)

Order of Operations

Python follows standard mathematical order of operations (PEMDAS). Use parentheses when you want to be explicit:

Python
# Without parentheses -- multiplication happens first
result = 10 + 5 * 2
print(result)     # 20 (not 30)

# With parentheses -- addition happens first
result = (10 + 5) * 2
print(result)     # 30

Practical Example: Real Estate Math

Python
purchase_price = 1_200_000          # Underscores for readability (Python ignores them)
annual_rent_income = 144_000
operating_expenses = 48_000

# Net Operating Income
noi = annual_rent_income - operating_expenses
print(f"NOI: ${noi:,.2f}")         # NOI: $96,000.00

# Capitalization Rate
cap_rate = noi / purchase_price
print(f"Cap Rate: {cap_rate:.2%}")  # Cap Rate: 8.00%

# Gross Rent Multiplier
grm = purchase_price / annual_rent_income
print(f"GRM: {grm:.1f}")           # GRM: 8.3
Underscores in Numbers

Python lets you use underscores in large numbers for readability. 1_200_000 and 1200000 are exactly the same value. Python ignores the underscores entirely -- they are just for human eyes. Use them freely in your code whenever a number has more than four digits.


Getting Input from Users

The input() function pauses your program and waits for the user to type something. Whatever they type comes back as a string -- always:

Python
name = input("What is your name? ")
print(f"Hello, {name}!")
What is your name? Marcus
Hello, Marcus!

Since input() always returns a string, you must convert it if you need a number:

Python
rent_text = input("Enter monthly rent: $")
rent = int(rent_text)                        # Convert to integer
annual = rent * 12
print(f"Annual rent: ${annual:,}")
Enter monthly rent: $4500
Annual rent: $54,000

You can combine the conversion and input into one line:

Python
rent = int(input("Enter monthly rent: $"))
units = int(input("Number of units: "))
print(f"Total annual income: ${rent * units * 12:,}")
User Input Can Crash Your Program

If someone types "hello" when your code expects a number, int("hello") will crash with a ValueError. For now, just be aware of this. In a later lesson on error handling, you will learn how to protect against bad input using try/except blocks.


Common Beginner Mistakes (And How to Fix Them)

Every new programmer hits the same walls. Here are the ones you will encounter first, and exactly how to get past them.

Quick Check

What is the main benefit of using Python Basics: Variables, Types, and Print well in Claude Code?

Mistake 1: Mismatched or Missing Quotes

Python
# Wrong -- mismatched quotes
# message = "Hello, world!'

# Wrong -- missing closing quote
# message = "Hello, world!

# Right
message = "Hello, world!"
message = 'Hello, world!'

If your error message says SyntaxError: EOL while scanning string literal, it almost always means you forgot a closing quote.

Mistake 2: Using a Variable Before Defining It

Python
# Wrong -- Python does not know what 'price' is yet
# print(price)
# price = 4500

# Right -- define first, then use
price = 4500
print(price)

Python reads your code from top to bottom. If you try to use a name before you have assigned a value to it, you get a NameError.

Mistake 3: Confusing = and ==

Python
# This ASSIGNS the value 10 to x
x = 10

# This CHECKS whether x equals 10 (returns True or False)
x == 10

Using = when you mean == (or vice versa) is one of the most common bugs in programming. You will work with == more when you learn about conditionals.

Mistake 4: Trying to Do Math with Strings

Python
# This does not add 10 + 20. It concatenates two strings!
result = "10" + "20"
print(result)        # "1020" (not 30!)

# Fix: convert to numbers first
result = int("10") + int("20")
print(result)        # 30

Mistake 5: Forgetting Parentheses on Function Calls

Python
# Wrong -- this references the function itself, does not call it
# print
# type

# Right -- parentheses execute the function
print("Hello")
type(42)

Mistake 6: Indentation Errors

Python uses indentation (spaces at the start of a line) to structure code. In this lesson, you have not needed indentation yet, but you will the moment you write an if statement or a loop. For now, make sure every line of your code starts at the left margin unless a tutorial specifically tells you to indent.

Python
# Wrong -- unexpected indent
#     print("Hello")

# Right
print("Hello")

Apply: Hands-On Practice

Now it is time to write code yourself. These exercises build on each other -- each one is slightly harder than the last.

Exercise 1: Your Digital Business Card

Create a Python script that stores your professional information in variables and prints a formatted business card. Use f-strings.

Python
# Fill in your own information
name = "Your Name"
title = "Your Job Title"
company = "Your Company"
email = "your.email@example.com"
years_experience = 5

print("=" * 40)
print(f"  {name}")
print(f"  {title}")
print(f"  {company}")
print(f"  {years_experience} years of experience")
print(f"  {email}")
print("=" * 40)

Run it and verify the output looks like a proper card. Then try changing "=" * 40 to "-" * 40 or "#" * 40 -- notice how * with a string repeats it. This is called string repetition.

Exercise 2: Type Detective

Predict the type of each value before running the code. Then run it and check your predictions:

Python
a = 42
b = "42"
c = 42.0
d = True
e = "True"
f = None

print(f"a = {a}, type = {type(a)}")
print(f"b = {b}, type = {type(b)}")
print(f"c = {c}, type = {type(c)}")
print(f"d = {d}, type = {type(d)}")
print(f"e = {e}, type = {type(e)}")
print(f"f = {f}, type = {type(f)}")

Key insight: 42 and "42" are fundamentally different. The first is a number you can do math with. The second is text that happens to contain digit characters. Similarly, True (boolean) and "True" (string) are completely different types. The quotes make all the difference.

Exercise 3: Temperature Converter

Write a script that asks the user for a temperature in Fahrenheit and converts it to Celsius. The formula is: C = (F - 32) * 5/9

Python
fahrenheit = float(input("Enter temperature in Fahrenheit: "))
celsius = (fahrenheit - 32) * 5 / 9

print(f"{fahrenheit:.1f}F = {celsius:.1f}C")

Test it with these known values:

  • 32F should give 0.0C
  • 212F should give 100.0C
  • 98.6F should give 37.0C

Bonus: Add a line that also converts to Kelvin (K = C + 273.15).

Exercise 4: String Surgery

Practice string methods by running this code and observing each result:

Python
raw_response = "  The Property Is Located in DOWNTOWN Denver.  "

print(f"Original:    '{raw_response}'")
print(f"Stripped:    '{raw_response.strip()}'")
print(f"Lowercase:   '{raw_response.strip().lower()}'")
print(f"Uppercase:   '{raw_response.strip().upper()}'")
print(f"Title Case:  '{raw_response.strip().title()}'")
print(f"Replaced:    '{raw_response.strip().replace('Denver', 'Austin')}'")
print(f"Word count:  {len(raw_response.strip().split())}")
print(f"Starts with space: {raw_response.startswith(' ')}")
print(f"Contains 'Denver': {'Denver' in raw_response}")

Notice how you can chain string methods: .strip().lower() first removes whitespace, then converts to lowercase. Each method returns a new string that the next method operates on.

Mini-Project: AI Cost Calculator

Now let's build something practical -- a calculator that estimates how much an AI API call will cost. When you use AI models like Claude or GPT through their APIs (which you will learn to do later in this track), you pay based on the number of tokens processed. A token is roughly 3-4 characters of text.

Quick Check

After reading this lesson, what should you validate when applying Python Basics: Variables, Types, and Print?

Mini-Project: Build an AI Cost Calculator

Build this step by step. Type each section, run it, and make sure it works before moving to the next.

Step 1 -- Define pricing constants:

Python
# Pricing per 1,000 tokens (approximate, as of 2026)
CLAUDE_SONNET_INPUT = 0.003      # $3 per million input tokens
CLAUDE_SONNET_OUTPUT = 0.015     # $15 per million output tokens
GPT4O_INPUT = 0.005              # $5 per million input tokens
GPT4O_OUTPUT = 0.015             # $15 per million output tokens

Step 2 -- Get user input:

Python
print("=== AI Cost Calculator ===")
print()

# Estimate tokens from word count (rough rule: 1 word = about 1.3 tokens)
input_words = int(input("How many words in your prompt? "))
output_words = int(input("Expected words in the response? "))
num_calls = int(input("How many API calls will you make? "))

input_tokens = int(input_words * 1.3)
output_tokens = int(output_words * 1.3)

Step 3 -- Calculate costs:

Python
# Cost per call (convert from per-million to per-token)
claude_cost_per_call = (input_tokens * CLAUDE_SONNET_INPUT / 1000) + (output_tokens * CLAUDE_SONNET_OUTPUT / 1000)
gpt4o_cost_per_call = (input_tokens * GPT4O_INPUT / 1000) + (output_tokens * GPT4O_OUTPUT / 1000)

# Total cost
claude_total = claude_cost_per_call * num_calls
gpt4o_total = gpt4o_cost_per_call * num_calls

Step 4 -- Display results:

Python
print()
print(f"Input tokens per call:  {input_tokens:,}")
print(f"Output tokens per call: {output_tokens:,}")
print(f"Number of calls:        {num_calls:,}")
print()

model_label = "Model"
per_call_label = "Per Call"
total_label = "Total"
print(f"{model_label:<20} {per_call_label:>10} {total_label:>12}")
print("-" * 44)

claude_label = "Claude Sonnet"
gpt_label = "GPT-4o"
print(f"{claude_label:<20} ${claude_cost_per_call:>9.4f} ${claude_total:>11.4f}")
print(f"{gpt_label:<20} ${gpt4o_cost_per_call:>9.4f} ${gpt4o_total:>11.4f}")
print()

savings = abs(gpt4o_total - claude_total)
cheaper = "Claude Sonnet" if claude_total < gpt4o_total else "GPT-4o"
print(f"{cheaper} is ${savings:.4f} cheaper for this workload.")

Test with these values: 500 input words, 300 output words, 100 calls. You should see costs in the range of a few cents to a few dollars -- AI APIs are remarkably affordable for most use cases.

Challenge extensions (if you want more practice):

  1. Add a third model (Claude Haiku: $0.00025 input, $0.00125 output per 1K tokens)
  2. Add a monthly projection (multiply by 22 working days)
  3. Add sales tax calculation at 8.5%

Key Takeaways

  • A variable is a named label for a piece of data -- create one with name = value and Python figures out the type automatically
  • Python has four fundamental data types you will use constantly: strings (text in quotes), integers (whole numbers), floats (decimal numbers), and booleans (True/False)
  • f-strings are the professional way to embed variables in text -- put f before the quotes and wrap variables in curly braces: f"Hello, {name}"
  • The print() function is both your primary output tool and your best debugging tool -- when something goes wrong, print your variables and their types to find the bug
  • Type conversion functions (int(), float(), str()) translate between data types -- you will use these constantly when working with AI APIs that pass data as strings
  • Python uses = for assignment (storing a value) and == for comparison (checking equality) -- confusing these is one of the most common beginner bugs
  • Comments (#) explain the why behind your code, not the what -- good variable names should make the "what" obvious
  • The input() function always returns a string, even if the user types a number -- convert it with int() or float() before doing math

Reflect: From Print Statement to Possibility

Let us return to Marcus. After his first evening writing Python, he did not immediately build anything that transformed his business. He went to bed having written a few dozen lines of code -- variables, print statements, some basic arithmetic. Nothing his spreadsheet could not have done.

But something had shifted. The next morning, over coffee, Marcus found himself thinking differently about his work. He looked at the market report he had to prepare and instead of seeing a tedious four-hour task, he saw a sequence of steps: gather rental data, calculate averages, compare to last quarter, format the output. Steps that could be described. Steps that could be automated. Steps that could be coded.

He did not know how to do any of that yet. He did not know about loops or functions or API calls. But he knew -- because he had experienced it the night before -- that he could give Python an instruction and it would follow it precisely. That was enough. That one fact, proven by the simple act of seeing Hello, Marcus appear on screen, had rewritten his mental model of what was possible.

How confident do you feel about applying Python Basics: Variables, Types, and Print in a real project?

This is the real value of what you learned in this lesson. The variables, types, and print statements are essential building blocks -- you will use every one of them in every program you write. But the deeper lesson is that you can make a computer do things by describing what you want in a structured way. That skill, the ability to think in steps and translate those steps into instructions, is what separates people who use AI tools from people who build with them.

In the next lesson, you will learn how to make Python decide things -- choosing different paths based on conditions, repeating actions across lists of data, and building reusable blocks of logic called functions. The real power of programming is about to begin.

But first, go run that AI cost calculator. Change the numbers. Break it on purpose and fix it. Every error message you see and resolve is a small victory. Every line of code you write -- even if it is just print("Hello") -- is proof that you belong here.