Python Functions: Write Once, Use Anywhere

Day 5 of my Python Full Stack journey. ✅ Today's topic: Functions — write once, use anywhere. This is where Python starts feeling like real programming. Instead of copying the same code 10 times — you wrap it in a function and call it. Here's what I typed today: def greet(name, role="Developer"): return f"Hey {name}, future {role}!" msg = greet("Punith") print(msg) # Output: Hey Punith, future Developer! Biggest lesson today: Default arguments make functions flexible. You only pass them if you want to override the default. Small thing. But it made everything click. — Here's what I covered in 5 days: → Variables & Data Types → Conditionals → Loops → Functions → Built a Calculator from scratch — pushed to GitHub ✅ 45 minutes a day. No excuses. #PythonFullStack #Day5 #Week1Done #BuildingInPublic #100DaysOfCode #Bangalore

  • text

To view or add a comment, sign in

Explore content categories