🐍 Python Basics – Learning Notes (Day Update) Here are some key Python concepts I’ve been practicing 👇 🔹 split() - Breaks a string into parts and returns them as a list. 🔹 len() - A built-in function used to count the number of items in an object. 🔹 rsplit() - “Right split” — splits a string starting from the right side. 🔹 strip() - Removes spaces from both left and right sides. 🔹 lstrip() / rstrip() - Removes spaces from left / right side respectively. ✔️ startswith() → Verifies if a string starts with a specific value ✔️ endswith() → Checks if a string ends with a given value 🔹 String Validation Methods (True / False) ✔️ isdigit() → Checks if string contains only digits (0–9) ✔️ isalnum() → Checks if string contains letters + numbers ✔️ isalpha() → Checks if string contains only alphabets 🔹 Control & Flow Concepts ✔️ if / else → Decision Making Executes code based on conditions. ✔️ for loop → Repeat Execution Iterates over sequences like list, string, or range. #Python #Programming #Coding #PythonBasics #DeveloperJourney
Python Basics: String Methods and Control Flow
More Relevant Posts
-
Today was one of those Python lessons that felt less like learning code and more like learning how to read its warnings properly. 🐍 Day 15 of my #30DaysOfPython journey was all about errors, and honestly, this topic matters because every developer runs into them. When Python code fails, it gives feedback that tells us where the issue is and what kind of problem it is. Learning to understand those messages makes debugging a lot faster. Today I went through the common ones: 1. SyntaxError — when the code is written incorrectly 2. NameError — when a variable has not been defined 3. IndexError — when an index goes out of range 4. ModuleNotFoundError — when a module cannot be found 5. AttributeError — when an attribute does not exist 6. KeyError — when the wrong key is used in a dictionary 7. TypeError — when an operation is applied to the wrong data type 8. ImportError — when something is imported incorrectly 9. ValueError — when the value is valid in type, but not in meaning 10. ZeroDivisionError — when a number is divided by zero What stood out to me today was how errors are not just problems — they are clues. Once you stop panicking and start reading them properly, debugging becomes a lot less intimidating. One more day, one more topic, one more step toward writing code with less guessing and more understanding. Which error has annoyed you the most while coding so far? #Python #LearnPython #CodingJourney #30DaysOfPython #Programming #DeveloperJourney
To view or add a comment, sign in
-
Most people don’t forget Python They forget it because they stop using it. That was my problem. I came back to coding and realized something frustrating: I understood the concepts… but I couldn’t remember the syntax clearly. So instead of just relearning randomly, I did something different. I built a complete Python A–Z repository — not just to learn, but to never forget again. What makes this different? This is NOT just notes. This is a structured, practical guide designed to: 1. Help you quickly recall Python syntax after a break 2. Give you clear explanations with examples 3. Take you from basics to advanced step by step 4. Be your go-to reference anytime you feel lost What’s inside? 1. Python Fundamentals 2. Control Flow 3. Loops 4. Data Structures 5. Functions 6. Object-Oriented Programming (OOP) 7. File Handling 8. Error Handling 9. Modules & Packages 10. Advanced Python (Decorators, Generators, etc) Why I’m sharing this: Because I know many people struggle with the same thing: You learn… you stop… you forget… you start again. This is built to break that cycle. GitHub Repository: https://lnkd.in/dUSyqH2h What’s next? 1. More projects. 2. More practical content. 3. More real-world applications. I’ll keep sharing everything I build along the way. If you're learning Python or working on improving your skills, follow me I’ll be sharing practical content that actually helps. And tell me: What’s the hardest thing for you in Python right now? #Python #Programming #AI #MachineLearning #DataScience #SelfLearning
To view or add a comment, sign in
-
11 Useful Python List Methods Working with lists is common in almost every Python project. Understanding these built-in methods makes your code cleaner and more efficient. Here are 11 essential list methods: 1) append() → Add a single item to the list. 2) extend() → Add multiple items individually. 3) insert() → Add an item at a specific index. 4) remove() → Remove the first matching item. 5) pop() → Remove and return an item. 6) index() → Find the position of an item. 7) count() → Count how many times an item appears. 8) sort() → Sort the list in place. 9) reverse() → Reverse the order of elements. 10) clear() → Remove all items from the list. 11) reverse() → Reverse the order of elements. These small methods are simple, but they appear frequently in real-world code. Mastering them improves readability and reduces unnecessary logic. Comment below, Which list method do you use the most? Comment below. Save this for quick revision later. 📌 I share simple Python and backend learnings here. #Python #LearnPython #Programming #Coding #SoftwareEngineering #PythonDeveloper
To view or add a comment, sign in
-
-
Today, I learned some fundamental concepts in Python related to variables and assignments. 🐍 🔹 Multiple Variable Assignment We can assign multiple values to multiple variables in a single line: x, y, z = "John", "Vijay", "Dhoni" print(x, y, z) ✅ Output: John Vijay Dhoni 👉 The number of variables and values must match, otherwise Python will raise an error. ⚠️ 🔹 Assigning the Same Value to Multiple Variables We can assign the same value to multiple variables like this: a = b = c = "Python" print(a, b, c) ✅ Output: Python Python Python 🔹 Checking Data Type We can check the data type of a variable using the type() function: x = 5 print(type(x)) ✅ Output: <class 'int'> 🔹 Unpacking a List We can assign values from a list to variables: subjects = ["HTML", "CSS", "JS"] x, y, z = subjects print(x) ✅ Output: HTML 🚀 Step by step, I’m building my Python fundamentals and improving every day! #Python #Programming #Coding #Beginners 💻🔥
To view or add a comment, sign in
-
Python List Methods Tip: append() and extend() Most Python Beginners Don’t Realize This List Mistake, append() and extend() look almost the same… But using the wrong one silently changes your data structure. Here’s the real difference: - append() adds the entire object as ONE element. - extend() adds each element individually. That means this: - append() → Creates nested lists - extend() → Keeps list flat Why This Matters: - This small mistake often causes unexpected bugs while looping, filtering, or processing data. - Many developers only notice it when their logic suddenly stops working. Simple Rule To Remember: - If you want to add one item → append() - If you want to merge items → extend() Small concepts like this make your Python code cleaner and easier to debug. Have you ever accidentally created a nested list using append()? #Python #LearnPython #PythonTips #Programming #Coding #SoftwareEngineering #PythonDeveloper
To view or add a comment, sign in
-
-
Most Python developers stop learning after `for` loops and list comprehensions. And honestly… Python lets you get away with it for a long time. But once you start writing real systems, things change. You suddenly hear words like: Decorators Generators Dataclasses Multiprocessing Caching And that moment hits you: “Wait… Python can do that?” So I put together a Python Advanced Cheat Sheet that covers some powerful concepts developers should know once they move beyond beginner scripts. Inside the cheat sheet: • Generators for memory-efficient pipelines • Decorators to extend function behavior • Dataclasses to reduce boilerplate • Multiprocessing to utilize CPU cores • Caching techniques to speed up heavy computations Because writing Python is easy. Writing good Python is a different skill. And let’s be honest… Most of us started Python with: `print("Hello World")` …and somehow ended up debugging why our decorator is wrapping another decorator. If you're learning Python or leveling up your coding skills, this cheat sheet might help. Free Python Advanced Cheat Sheet in the post below. Save it for later. It might come in handy during your next debugging session. #Python #PythonProgramming #Programming #SoftwareEngineering #Coding #Developers #LearnToCode #TechEducation
To view or add a comment, sign in
-
Today’s Python lesson felt less like learning syntax and more like learning how to stay calm when code gets messy. 🐍 Day 17 of my #30DaysOfPython journey was all about exception handling, and this one felt very real because errors are not rare — they are part of the process. Python gives us a way to handle errors without crashing the whole program. That makes code feel a lot more dependable. Today I explored: 1. try → run the risky code 2. except → handle the problem if something goes wrong 3. else → run only when no exception happens 4. finally → run no matter what I also learned about: 1. unpacking lists and tuples using *variable_name 2. unpacking dictionaries using **variable_name 3. packing values with *args and **kwargs 4. spreading values into function calls 5. enumerate() → when you need both index and value 6. zip() → when you want to loop through multiple lists together What stood out to me today was this: good code is not code that never fails — it is code that knows how to handle failure properly. One more day, one more topic, one more reminder that writing Python is also about writing with patience. Which one feels most useful in real code to you: try/except, enumerate(), or zip()? Github Link - #Python #LearnPython #CodingJourney #30DaysOfPython #Programming #DeveloperJourney
To view or add a comment, sign in
-
🚀 Day 68 | Python Revision (Up to Recursion) Today I focused on revising all Python concepts up to recursion 📘 🔹 What I Revised: • Basics → variables, data types, input/output • Control statements → if-else, loops • Functions → user-defined functions, arguments • Built-in functions → len(), sum(), min(), max(), etc. • String methods → strip(), split(), replace(), join() • List & Dictionary operations • Lambda functions and functional programming basics • Recursion → factorial, list flattening 💡 Key Learning: • Revision helps in connecting all concepts together • Improved clarity on when to use loops vs recursion • Strengthened understanding of problem-solving approaches 🔥 Takeaway: 👉 Strong fundamentals come from consistent revision Consistency + Revision = Confidence 🚀 #Day68 #Python #Revision #Recursion #ProblemSolving #CodingJourney #10000Coders #PythonDeveloper #SravanKumarSir
To view or add a comment, sign in
-
Many Python I/O tutorials end at print() and open(). This one goes further. On PythonCodeCrack there's a full beginner tutorial on Python I/O that covers the ground many skip — not just how to use the tools, but why they work the way they do. What's inside: — stdin, stdout, and stderr: what they are, where they come from, and why Python didn't invent them — print() in full: sep, end, flush, and why flush=True doesn't mean your data is on disk — input() and why it always returns a string no matter what the user types — File modes r, w, a, and x — including why 'w' truncates before the first write, not during it — The three-layer CPython I/O stack (TextIOWrapper → BufferedWriter → FileIO) and how to inspect it live — PEP 393: why a single emoji in a 2 GB text file can force 4 bytes per character across the entire string — buffering=1 line-buffered mode for crash-safe log files — flush() vs os.fsync() — two entirely different operations that most tutorials treat as the same thing — Python 3.15 making UTF-8 the default on all platforms, and what that means for existing code — sys.__stdout__ vs sys.stdout, newline translation, file descriptors, and TOCTOU race conditions The tutorial includes interactive quizzes, spot-the-bug challenges, a code builder, predict-the-output exercises, a 15-question final exam, and a downloadable certificate of completion. https://lnkd.in/gbYPmYgv #Python #PythonProgramming #LearnPython #CodingEducation
To view or add a comment, sign in
-
🚀 Day 7 of My Python Learning Journey Today, I explored one of the most powerful and flexible data structures in Python — Lists 🐍 Think of a list like a smart container 📦 that can hold anything — numbers, strings, even mixed data — all in one place! 🔍 What I learned: ✨ Lists are ordered, mutable, and allow duplicates ✨ Represented using square brackets [ ] ✨ Supports indexing for easy access ✨ Can store heterogeneous elements 💡 Ways to take input into a list: Using loops (element by element) Using map() for single-line input (clean and efficient!) ⚙️ Explored Inbuilt Methods: 🔹 append() – Add elements at the end 🔹 clear() – Remove all elements 🔹 copy() – Create a new list (avoiding aliasing!) 🔹 count() – Count occurrences of an element 🔹 extend() – Merge lists 🔹 index() – Find position of an element 🔹 insert() – Add element at specific position 🔹 pop() – Remove elements (and return them!) 🧠 One small realization today: Lists aren’t just collections… they’re like mini toolkits that make data handling smooth and dynamic. 📈 Slowly building consistency, one concept at a time! #Python #CodingJourney #LearningInPublic #100DaysOfCode #PythonBasics #Programming #StudentLife #TechSkills
To view or add a comment, sign in
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development