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

Type conversion

Level 5 of 50 · Basics

Level 5 of 50

Type conversion

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

📒 Open the cheat sheet
SanaRickshaw fare is 200, plus 50 tip. And my code CRASHED!
TeacherBecause your 200 was text! Let's convert it!
fare.py
fare = "200"
print(fare + 50)
TeacherText + a number? Python says NO!
SanaBut it looks like a number!
TeacherQuotes make it text! Wrap it in int(), and it's a real number again!
fare.py
fare = "200"
print(int(fare) + 50)
Teacher200 + 50 = 250! float() and str() convert the same way!

⏸ Pause & predict: what prints?

print(int("7") + 3)
Next: input() →← Data types

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.