Pradumya Gupta’s Post

🚀 Day 57 of #100DaysOfCode — Text Formatting & String Manipulation Hey everyone! 👋 Today’s challenge was all about cleaning up data: Capitalizing the first letter of a string while ensuring the rest are lowercase. It’s a common task in web development and data processing to make user input look consistent. 👨💻 What I practiced today: ✅ Case Normalization: Using .lower() to standardize the entire string first. ✅ String Indexing: Accessing the first character with [0] to apply .upper(). ✅ String Concatenation: Merging the transformed first character with the rest of the string using slicing [1:]. 📌 Today’s Task: ✔ Input: A string like "WORLD" or "hello". ✔ Goal: Return a properly formatted string with only the first letter capitalized. ✔ Example: "WORLD" → "World" | "hello" → "Hello". 🧠 Key Insight: While I manually handled the slicing and case conversion today, Python actually has a built-in method called .capitalize() that does exactly this in one step! Understanding the manual way helps me grasp how strings are immutable and how new strings are built in memory. ✨ Key Takeaway: String manipulation is a foundational skill. By breaking a string apart and reassembling it, you learn how to handle more complex text-processing tasks like title casing or custom data parsers in the future. #100DaysOfCode #Day57 #Python #CodingJourney #DSA #Strings #CleanCode #WebDevelopment #DataCleaning #SoftwareEngineer

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories