Skip to content
← Python for AI/ML · all 50 levels

f-strings

Level 7 of 50 · Basics

Level 7 of 50

f-strings

explained with Eid money. Watch the reel, then work through it below: run the code, take the quiz, keep the cheat sheet.

📒 Open the cheat sheet
SanaEid Mubarak! I want my code to say exactly how much eidi I got!
TeacherText and variables in one line? That's an f-string!
eidi.py
name = "Zara"
eidi = 500
print(f"{name} got {eidi}!")
TeacherPut f before the quotes. Anything in { } gets filled in!
SanaWhat does that tiny f do?
Teacherf means format! It tells Python: fill in the { }!
eidi.py
eidi = 500
print(f"Double: {eidi * 2}")
TeacherYou can even do maths inside! Double eidi!

⏸ Pause & predict: what prints?

total = 900
print("Bill: {total}")

Where this leads

Python is step one. Building AI that ships is the rest.

The diploma takes you from zero to deployed computer vision, LLM and agent projects, with engineers who build them for a living. Already code? The bootcamp does it in three months.