Python. Lesson 1 - Python is Your Pet Snake
PYTHON

Lesson 1: Python is Your Pet Snake; It Does Whatever You Tell It


(Unless you tell it stupid things. Then it bites.)

🧠 PART 1: How to Talk to Python Without Sounding Like a Clown

You’re gonna open a .py file (that’s just a fancy way of saying a Python script). Or use a notebook if you want to feel like a Pinterest-core tech goddess. Doesn’t matter.

Let’s learn how to declare, print, and make choices.

📝 1. VARIABLES — Your Memory Pockets

Python remembers stuff for you.
You tell it: “Hey, this name? Save it. I might use it later.”


🖨️ 2. PRINT — Loud and Proud

You want to see what’s inside your variable? Say it with your chest.
(Well, Python’s chest. Yours is for contour and confidence.)

Or, use this modern magic called f-strings (they’re chic):


3. IF STATEMENTS — Being Picky

You like choices. Python does too.
This is how you make it judge things, like you judging my playlist:


🔁 4. LOOPS — Repeating Without Losing Your Mind

You want to do something multiple times without copying & pasting code like a rookie?


🧮 5. Integers vs. Floats — Numbers That Judge You

  • Integer = whole number (like your ex’s emotional range: limited)
  • Float = decimal number (like your willpower around cupcakes: unstable)

✂️ 6. String Methods — When You Wanna Be Extra With Words

Strings are just text. But Python lets you style them like they’re going to the Met Gala.


🎒 7. Lists — Group Chat Vibes

Lists are how Python keeps multiple items in one cute little purse.


🔑 8. Dictionaries — Your Secrets and Tea Organizer

Remember: it’s {"key": "value"}
So elegant. So nosy.


🎭 9. Booleans — True or False, Just Like Red Flags

Python has a dramatic side. It only sees True or False.


🔁 10. While Loops — Repeat Until Sanity is Lost

Careful. This keeps going while a condition is true. You have to stop it. Just like overthinking.


🎨 11. Input — Let the User Talk Back

Let Python ask questions and store your answers. Kind of like a Choose Your Own Destiny novel but sassier.

🪄 8. len() — When You Want the Vibe Check on Length

Get the length of anything that’s list-ish, string-ish, or just generally drama-filled.

Also works on lists:

sneaky_links = ["Chad", "Not-Chad", "Definitely Chad Again"]
print(len(sneaky_links)) # 3 — seek help

🧽 9. .strip() — Cleans Up Strings Like a PR Agent

People (and strings) be messy. strip() removes extra spaces from the ends.
Perfect for when someone sends “ hey ” and you know they’re not serious.


💅 10. range() — Queen of Counting (but Make It Python)

Used in loops, range() lets you count without breaking a nail.

This prints 3 times: 0, 1, 2. Because Python starts at 0 like it’s emotionally unavailable.

RECOMMENDED  How to use len() in Python: 👀 Real Reasons You’d Use len()

Wanna start somewhere else?


Boom. You now have 14 shiny Python tools.

💋 BONUS TRICK — Your First Custom Function

You can make your own command, like a spellbook:


Alright. Do not skip this part. Copy the code. Run it. Break it. Fix it.

If you want to impress me, change the variables to something very you. I want sass. I want glam. I want tech-baddie energy.

Then send me the results.

Spread the love

You'll also like...