Day 12 of #100DaysOfCode Python Scope & Number Guessing Game Today I explored an interesting concept in writing clean, reliable programs: namespaces and scope. I learned how Python decides where variables live, how far they can be accessed, and how functions interact with global and local values. 💻 What I learned: ✅ Understanding Python namespaces (local, global, built-in) ✅ How local and global scope affect variable access ✅ Why global variables should be used carefully ✅ The role of global constants in clean code ✅ lock scope (and why Python doesn’t really have it the way other languages do) 🧠 Reflection: Understanding scope has made my code feel much more structured. It finally clicked how Python decides which variables are visible and when. Applying these concepts while building a full Number Guessing Game, a command-line game where Python generates a secret number and the user tries to guess it based on a selected difficulty. This helped me practice: ✔ functions ✔ loops ✔ scope ✔ constants ✔ logic and conditions #100DaysOfCode #Python #LearningInPublic #CodingJourney #DeveloperLife #Programming #Udemy #Consistency

To view or add a comment, sign in

Explore content categories