Become a data analyst in 90 days✦27 portfolio projects✦100+ interview Q&As✦1:1 mentor for a year✦See the 90-Day System →✦Become a data analyst in 90 days✦27 portfolio projects✦100+ interview Q&As✦1:1 mentor for a year✦See the 90-Day System →✦
New here? Want every day planned for you? See the 90-Day System →

Free PDF · Python

How I'd explain Python to a 5-year-old

12 Python ideas. One school day.

DGPython12 Python ideas, one school day12@thedataguy16

A variable is a tiffin box. A list is your school bag. A function is the canteen uncle.

If Python still feels scary, read this once. Every idea here is something you already know from school.

Then teach it to a friend. That's how it sticks.

explained to kids (1/2)

Python, the simple way

Variable

A tiffin box with your name on it. Rice today, roti tomorrow. The name stays the same.

lunch = "rice"

List

Books in your bag, in order. Python calls the first book number 0, not 1.

bag[0] # "maths"

Dictionary

The class register. Say a roll number, get the name. Roll number is the key.

roll = {1: "Asha"}

if/else

If it rains, games period is indoors. Else, everyone goes to the ground.

"indoor" if rain else "ground"

for loop

Teacher calls every name in the register, one by one, till the last kid.

for kid in register:

while loop

Keep running laps till the whistle blows. You don't know the number of laps before.

while not whistle:

explained to kids (2/2)

Python, the simple way

Function

Canteen uncle. Give him 10 rupees, get a samosa. Same steps every single time.

def canteen(money):

import

Why write your own book? Borrow one from the library and use it.

import pandas as pd

String

Letter beads on a bracelet. Pick any bead by its place, starting at 0.

name[0] # "R"

Boolean

Attendance has only two answers. Present or absent. True or False.

present = True

try/except

Try flying the kite. If the string snaps, play cricket instead of crying.

try: ... except: ...

DataFrame

The big marks chart on the class wall. Rows are kids, columns are subjects.

pd.read_csv("marks.csv")

Ready for interview Python?

Once these click, try the 12 Python programs interviewers love to ask.

Free PDF

How I'd explain Python to a 5-year-old

Download the PDF

Opens in Google Drive. No sign-up.

Keep going

More free PDFs

90-Day System · become a data analyst→