🐍 Day 4 of Learning Python Today I learned one of the most important (and unique) concepts in Python — **Indentation**. Unlike other languages, Python doesn’t use {} to define blocks of code. Instead, it uses proper spacing (indentation) to structure the program. 👉 Example: ``` if True: print("This is correctly indented") if True: print("This will throw an error ❌") ``` Even a small mistake in spacing can break your code! 💡 Key Takeaways: * Indentation defines code blocks * Consistency is important (usually 4 spaces) * Makes code clean and highly readable Coming from a PHP background, this feels different but also very intuitive once you get used to it. Excited to keep learning more 🚀 #Python #Coding #LearningJourney #100DaysOfCode #Developers #Programming
Python Indentation Basics
More Relevant Posts
-
🧠 Python Trick Question x = (1, 2, 3) x[0] = 10 What will happen? 🤔 A: (10, 2, 3) B: Error C: None D: (1, 2, 3) 👇 Think before scrolling 👉 Answer: Error Because tuples are immutable. 🚀 Basics clear = strong foundation #Python #CodingChallenge #Developers #Programming #Learning
To view or add a comment, sign in
-
-
12 Python Dictionary Methods I Use Almost Every Day Dictionaries are everywhere in Python… But using them efficiently makes a real difference. These are some methods I rely on regularly: 1) get() → access keys safely (no KeyError). 2) items() → loop through key–value pairs easily. 3) update() → merge dictionaries cleanly. 4) pop() → remove a key and return its value. 5) popitem() → remove the last inserted pair. 6) keys() → quickly check available keys. 7) values() → inspect stored values. 8) fromkeys() → create dictionaries with default values. 9) in → fast key existence check. 10) len() → count total items. 11) clear() → reset dictionary safely. 12) dict() → simple and readable creation. From experience: Knowing these small methods well can make your code cleaner and faster to write. Comment below, Which dictionary method do you use the most? #Python #Programming #Coding #Developers #PythonTips #SoftwareEngineering #LearnPython
To view or add a comment, sign in
-
-
📘 Day of Learning Python – Functions in Python 🐍 Today I focused on understanding Functions in Python, one of the most important concepts for writing clean, reusable, and organized code. Functions help us break a large program into smaller parts, making code easier to understand, test, and maintain. Instead of writing the same logic again and again, we can define it once and call it whenever needed. In today’s practice, I explored: 🔹 Defining functions using def 🔹 Calling functions with arguments 🔹 Returning values using return 🔹 Difference between parameters and arguments 🔹 Writing simple programs using functions like palindrome check, even/odd check, and factorial What I understood most is that functions improve problem-solving by making programs modular and structured. They are the foundation for writing efficient code in real-world applications. Every small concept learned today adds confidence for tomorrow’s bigger challenges. Consistent practice is helping me strengthen my programming basics step by step. Looking forward to learning more and applying these concepts in advanced programs. 🚀 Codegnan Saketh Kallepu #Python #PythonProgramming #FunctionsInPython #CodingJourney #LearningPython #ProgrammingBasics #CodePractice #TechLearning #PythonDeveloper #StudentLearning #LinkedInLearning- day 15
To view or add a comment, sign in
-
-
🚀 Exploring Python Loops & Control Statements: The Core of Logical Programming While learning Python, I realized how important loops and control statements are for writing efficient and logical code. Here’s a quick summary of what I understood: 🔹 For Loop Used to iterate over a sequence like lists, tuples, or strings. Best when the number of iterations is known. 🔹 While Loop Runs as long as a condition is true. Useful when the number of iterations isn’t fixed. 🔹 If, Elif, Else Helps in decision-making by executing code based on conditions. 🔹 Break Statement Used to exit a loop immediately when a condition is met. 🔹 Continue Statement Skips the current iteration and continues with the next one. 🔹 Pass Statement Acts as a placeholder when no action is needed but syntax requires a statement. 💡 These concepts are helping me build stronger programming logic step by step. 📌 Always open to learning more and improving! #Python #LearningJourney #Programming #Coding #Loops #ControlStatements
To view or add a comment, sign in
-
-
🍀🚀 Exploring Python Loops & Control Statements: The Core of Logical Programming While learning Python, I realized how important loops and control statements are for writing efficient and logical code. Here’s a quick summary of what I understood: 🔹 For Loop Used to iterate over a sequence like lists, tuples, or strings. Best when the number of iterations is known. 🔹 While Loop Runs as long as a condition is true. Useful when the number of iterations isn’t fixed. 🔹 If, Elif, Else Helps in decision-making by executing code based on conditions. 🔹 Break Statement Used to exit a loop immediately when a condition is met. 🔹 Continue Statement Skips the current iteration and continues with the next one. 🔹 Pass Statement Acts as a placeholder when no action is needed but syntax requires a statement. 💡 These concepts are helping me build stronger programming logic step by step. 📌 Always open to learning more and improving! #Python #LearningJourney #Programming #Coding #Loops #ControlStatements
To view or add a comment, sign in
-
-
🚀 3 Python Tricks That Will Make Your Code 10x Cleaner Writing code is one thing, but writing clean, readable, and efficient Python code is what separates good developers from great ones. Here are three tricks I use to level up my Python projects: 1️⃣ List Comprehensions & Generators – Replace loops with concise expressions to save lines and memory. 2️⃣ F-Strings for Formatting – Clear, fast, and readable string formatting. 3️⃣ Use Enumerate Instead of Range – Cleaner iteration with index and value together. 💡 Pro Tip: Small changes like these drastically improve readability and maintainability of your projects. 📌 Comment below: Which Python trick is your favorite, or do you have one to add? #Python #CodingTips #CleanCode #DeveloperLife #Programming
To view or add a comment, sign in
-
-
10 Python Built-in Functions You Should Know: If you’re learning Python or writing code daily, these built-in functions will save you time and make your code cleaner: 🔹 len() → Count items in a list or string. 🔹 zip() → Combine two lists into pairs. 🔹 map() → Apply a function to every item. 🔹 filter() → Filter items based on a condition. 🔹 any() → Returns True if any item is True. 🔹 all() → Returns True if all items are True. 🔹 sum() → Adds up elements in an iterable. 🔹 sorted() → Sorts items. 🔹 enumerate() → Adds index to items. 🔹 range() → Generates a sequence of numbers. Mastering these small functions is very helpful in writing clean code. Which one do you use the most? #Python #Programming #Developers #Coding #SoftwareEngineering #CodingInterview #PythonDeveloper
To view or add a comment, sign in
-
-
10 Python Built-in Functions You Should Know: If you’re learning Python or writing code daily, these built-in functions will save you time and make your code cleaner: 🔹 len() → Count items in a list or string. 🔹 zip() → Combine two lists into pairs. 🔹 map() → Apply a function to every item. 🔹 filter() → Filter items based on a condition. 🔹 any() → Returns True if any item is True. 🔹 all() → Returns True if all items are True. 🔹 sum() → Adds up elements in an iterable. 🔹 sorted() → Sorts items. 🔹 enumerate() → Adds index to items. 🔹 range() → Generates a sequence of numbers. Mastering these small functions is very helpful in writing clean code. Which one do you use the most? #Python #Programming #Developers #Coding #SoftwareEngineering #CodingInterview #PythonDeveloper
To view or add a comment, sign in
-
-
Strengthening my foundation in Python programming. Recently, I focused on understanding the core basics of Python: • Identifiers – Names used to represent variables, functions, and classes Example: name = "Manoj", marks = 95 • Operators – Symbols used to perform calculations and comparisons Example: +, -, *, /, %, == • Literals – Fixed values directly written in the program Example: 10, "Hello", 3.14, True • Data Types – Define the type of value stored in a variable Examples: int → 25 float → 7.5 str → "Python" bool → True Building strong fundamentals is the first step toward becoming a better programmer. #Python #Programming #LearningJourney #SoftwareDevelopment #Coding #PythonBasics
To view or add a comment, sign in
-
-
Day 7 of my Python learning journey 🐍 Today I started learning functions in Python, which is one of the most important concepts in programming and a key step toward becoming a better developer. Functions help us write reusable and organized code. Instead of repeating the same code again and again, we can define a function and use it whenever needed. Today I learned the basic syntax of functions and why we should use them. I also explored positional arguments and keyword arguments. In positional arguments, values are passed based on their position. In keyword arguments, values are passed using a key-value format, which makes the code more clear and readable. This was a very important step in understanding how real programs are structured. My work is here: https://lnkd.in/gGsjWtee #Python #100DaysOfCode #LearningInPublic #Django #MachineLearning 🚀
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