Python in 3 days. Every program here runs.

These are the complete notes from the Pusad workshop — every block is self-contained, so copy any one into a fresh Colab cell and it works. Press Run on any program to see what it prints. Then rebuild it without looking.

Sujeet Chavhan · PhD Scholar, CSE, IIT Kanpur · Rising Coder Edu Tech · risingcoder.in
Day 1

Setup: Python in your browser

Nothing to install. Google Colab runs Python on Google's computers; you just need a browser and a Gmail. Full setup, from zero:

  1. Open colab.research.google.com — on a laptop or even a phone (laptop is much better for typing code).
  2. Sign in with any Gmail account (the same one you use for YouTube works). If a "Welcome to Colab" example notebook opens, just close that tab of it — you want your own.
  3. Click File → New notebook in Drive (or the New Notebook button on the welcome popup). A page opens with one empty grey box — that box is called a cell.
  4. Rename it: click the title Untitled0.ipynb at the top-left and type something like pusad_workshop.ipynb. It auto-saves to your Google Drive from now on.
  5. Type code in the cell and press Shift + Enter to run it (or click the ▶ play button on the cell's left edge). The first run takes ~10 seconds — Colab is connecting you to a free computer in Google's data centre. After that, runs are instant.
  6. Need another cell? Click + Code at the top-left. Each cell runs on its own, but they all share the same variables — a variable you create in cell 1 works in cell 5.
If something goes wrong in Colab (read once, remember forever)

"Not connected" / grey RAM-Disk icon at top right: click Connect (top-right corner) and wait a few seconds.

Left Colab idle for a while and now variables are "not defined": Colab disconnects after long inactivity and forgets your variables (your code is safe in Drive, only the running memory resets). Fix: Runtime → Run all to re-run every cell from the top.

A cell is stuck / an infinite loop is running: press the ■ stop button on the cell (the ▶ turns into ■ while running), or Runtime → Interrupt execution.

Want your notebook back tomorrow? It's in your Google Drive inside the Colab Notebooks folder — or just open colab.research.google.com and it's listed under Recent.

Files like marks.csv disappear between sessions: files created by your code live on the temporary Colab computer, not in Drive — when the session resets they're gone. That's fine here: the notes always create the file first (re-run that cell).

Everything below works in Colab with zero installation — and also on a laptop with Python installed (see the free installation guide when you're ready for VS Code).

Variables — boxes that remember

A variable is a labelled box. The label stays; what's inside can change.

Try it: change what's in the box

name
"Priya"
city
"Pusad"
age
19

name = "Priya"; city = "Pusad"; age = 19

The f-string f"{name} from {city}" puts variables inside text. You'll use it in every program from now on.

input() — your program asks a question

Like a shopkeeper: asks, waits, remembers your answer.

input() always gives text. Wrap it in int() when you need a number for maths. Type letters where a number is expected and you'll get a ValueError — errors are normal, read the line number they mention.

if / elif / else — programs that decide

Remember the hall game: if you had poha, stand; elif only chai, raise your hand; else stay seated. Same input, different branch. That's a condition.

Try it: slide the marks, watch the branch

68
First class!

→ took the elif marks >= 60 branch

The four spaces before print are Python's grammar — they mean "this line belongs to the if". Colab adds them for you after a colon.

Loops — do it 1000 times without typing 1000 times

Attendance roll-call is a for loop (fixed count). Scrolling reels is a while loop (until something changes).

Try it: step through for i in range(1, 6)

i is not defined yet
(nothing printed yet)
A while loop must change something each round — count = count - 1 — or it runs forever. If that happens in Colab, press the stop button. Every programmer does it once.

Day 1 projects

Three complete programs. Run them, then rebuild each from a blank cell.

Project 1 — Bio Card + Marks Calculator

Project 2 — Number Guessing Game

Everything from Day 1 is inside this one game: input, int, while, if/elif/else, f-strings, break.

Project 3 — Your own chatbot (rule-based)

Rename the bot and add three rules of your own — cricket, movies, canteen. It follows your rules. On Day 3 you'll meet a bot that thinks.
Quick check: what does print(2 + 3) print, and what does print("2 + 3") print?
Quotes mean "this is text, don't calculate". Without quotes, Python does the maths.
A student types marks = input("Marks: ") and then marks / 100. What happens?
input() always returns text. Wrap it: marks = int(input("Marks: ")).
Day 2

Lists — many values in one variable

Yesterday you stored marks as m1, m2, m3. For 60 students that's 60 variables. A list holds all of them under one name.

Try it: click a cell to see its index

marks = [78, 92, 65, 88, 71]

marks[0] is the first element — counting starts at 0. Every programmer trips on this exactly once.

Dictionaries — real records

A list loses the names. A dictionary keeps the pair: name → marks. It's how a college register works — roll number → student.

Try it: look up a name

→ 78

students = {"Renu": 78, "Akash": 92, "Priya": 65, "Sana": 88}

students.get("Ram", "Not found") means: give me the value, or this message if the key doesn't exist. No crash.

Functions — write once, use forever

def defines a named piece of code. return sends the answer back. Write it once, call it a hundred times.

Files — data that survives

Close Colab and your dictionary is gone. Files make data permanent. Two lines to save, two to read back.

"w" = write (overwrites), "r" = read, "a" = append to the end.

Day 2 projects

Class Marks Analyzer

Student Database — a menu app

Student Record Manager — functions + a file (Day 2 capstone)

This program remembers students between runs. Run it, add two names, choose Save, restart the cell — they're still there. That's the difference between a script and software.
You want only the students who scored 75 or more from a list. Which line does it in one go?
That's a list comprehension: "give me m, for each m in marks, if m ≥ 75". You'll use it constantly.
Which one safely handles a name that isn't in the dictionary?
students[name] crashes with KeyError if the name is missing. .get() returns your fallback instead.
Day 3

CSV files & pandas

Real data lives in CSV files — comma separated values. First create one (run this once), then read it two ways: the manual way, and the professional way.

The manual way (your Day 2 file skills)

The pandas way — 20 lines become 3

groupby is the most useful command in data analysis: marks per branch, sales per city, cases per district. pandas is what data scientists and AI engineers use every day.

Real AI — your code talks to Gemini

Your Day 1 bot followed your rules. This one has read the internet. You need one thing first: a free API key — a password that lets your code (not your browser) talk to Google's AI.

Step 1 — Get your free API key (2 minutes, no card needed)

  1. Open aistudio.google.com and sign in with the same Gmail you used for Colab.
  2. Accept the terms if asked, then click Get API key (left sidebar or top-right button).
  3. Click Create API key. If it asks for a project, choose Create API key in new project.
  4. A long code appears, starting with AIza... — click Copy. That string is your key.
Treat the key like your ATM PIN. Don't message it to anyone, don't paste it in the WhatsApp group, don't upload code containing it to GitHub. If it ever leaks, go back to aistudio.google.com and delete it — you can create a new one in seconds, free.

Step 2 — Test the key (run this first)

In a new Colab cell, paste this, replace the key with yours (keep the quotes), and run. Nothing to install — requests is already on Colab.

Key not working? The three errors everyone hits

"API key not valid" (error 400): the key was copied incompletely, or the quotes got smart-formatted. Re-copy the whole AIza... string from aistudio.google.com and paste it between plain straight quotes "...".

"model not found" (error 404): the model name in the URL has a typo, or that model was retired. Check the url line character by character — or ask in the WhatsApp group for the current model name.

"quota exceeded" (error 429): the free tier allows a limited number of requests per minute. Wait a minute and run again — for learning, the free limit is plenty.

KeyError: 'candidates': the reply didn't contain an answer — usually one of the errors above in disguise. Add print(r.json()) before the failing line to see Google's actual error message.

Step 3 — Wrap it in a function and talk to it

We wrapped it in a function — ask_ai(anything) now works anywhere in your program. That's Day 2's skill making Day 3 possible.

Day 3 projects

Real Data Analyzer

AI Report Card Generator — the final project

Personalised feedback for 60 students in 30 seconds. A teacher would need two hours. That is what AI is for — and you built it on Day 3 of learning to code.
Which pandas line gives the average marks per branch?
groupby splits the table by branch, then mean() runs on each group.
After the workshop

Where to go next

Three days ago you had never written code. Today you built an AI application. The only students who fail at coding are the ones who stop — here's how not to stop.

This week — rebuild without looking

One program a day from these notes, from a blank cell, no peeking. When it breaks, read the error, fix it. Struggling is the learning.

Weeks 2–4 — practice + one project of your own

HackerRank easy problems daily (15 minutes). Then build something you'd actually use: attendance tracker, expense manager, notes organiser, canteen order app.

Month 2 — files, APIs, error handling

Connect your programs to the internet. Build a live Weather App. Learn try/except so your code stops crashing on bad input.

Month 3 — AI and data properly

NumPy and pandas in depth, an AI chatbot with memory, web scraping, automation. Put every project on GitHub — that's your placement portfolio.

Month 4+ — your first machine learning model

scikit-learn on a real dataset. For AI-branch students this is where your syllabus and your skills finally meet.

Free resources that are enough to start

Google ColabYour home. Python in the browser, free. HackerRank — PythonEasy problems, daily practice. W3Schools PythonReference when you forget syntax. Free lectures — @sujeetiitkFull course classes, free on YouTube. 7-Day Python ChallengeHarder problems when these feel easy. WhatsApp communityDoubts anytime. I reply.

Three days, one packed lab — Babasaheb Naik College of Engineering, Pusad, September 2026.

Live coding session on the projector during the 3-day Python workshop Instructor Sujeet Chavhan teaching with code on the projector screen Students in the computer lab during the Python workshop at Babasaheb Naik College of Engineering, Pusad Group photo of workshop students with instructor Sujeet Chavhan and faculty

Want the full journey? Python + AI — 3-month live course

The workshop was Month 1. The course continues with everything above — 24 live weekend classes, all recordings, WhatsApp doubt support, a capstone on your GitHub, and a certificate. Fee ₹3,499 — workshop attendees have their ₹250 adjusted. Sincere students who complete all assignments and pass the assessments get a full refund.

WhatsApp 8187907789 · risingcoder.in · risingcoder.edu@gmail.com