Python Starters Day 9 Foundation Nugget LOOP THROUGH DATA Lists become useful with loops. for fruit in fruits: print(fruit) Instead of writing instructions for each item, Python handles all automatically. Programs scale when logic applies to many items. The same idea runs social media feeds and bank transactions. Follow the Python 🐍 Starters Hub: WhatsApp: https://lnkd.in/dbjAFv52 LinkedIn: https://lnkd.in/dkJE3tZq
Python Looping Through Lists with For Loops
More Relevant Posts
-
Python Starters Day 13 Foundation Nugget Strings are data, too Strings behave like lists of characters. word = "Python Starter Hub" print(word[0]) That prints P. You can slice strings just like lists. Understanding that everything in Python is structured data, which unlocks the flexibility of this language. Text isn’t just text. It is an ordered character. Many beginners treat strings as basic, and they are not; they power logins, search, messaging, and more. Follow the Python 🐍 Starters Hub: WhatsApp: https://lnkd.in/dbjAFv52 LinkedIn: https://lnkd.in/dkJE3tZq
To view or add a comment, sign in
-
Day 45 : Python Operators for Decision Making Today I understood the Python Operators and how it is helpful for decision making. Hands-on : - Today I explored different types of operators in Python that are essential for decision-making and logical evaluation in programs. - I started with comparison operators, which are used to compare values (like ==, !=, >, <, >=, <=) and return boolean results. - Next, I learned about logical operators such as AND, OR, and NOT, which help combine multiple conditions and control the flow of programs based on complex logic. - Finally, I practiced membership operators like in and not in, which are used to check whether a value exists within a sequence such as a list, string, or tuple. - These concepts are fundamental for writing conditional statements and building real-world logic in Python programs. Result : - Successfully understood how to use comparison, logical, and membership operators to evaluate conditions and control program flow. Key Takeaways : - Comparison operators return True/False based on value comparisons. - Logical operators combine multiple conditions for complex decision-making. - Membership operators check whether a value exists in a sequence. - These operators are essential for writing if-else conditions and loops. #Python #Programming #DataAnalytics #LearningJourney #CodingBasics #Operators #DataScience #BeginnerPython #AnalyticsSkills
To view or add a comment, sign in
-
-
Python Starters Day 19 Foundation Nugget For continuity, use While Loops While loops repeat until something changes. count = 0 while count < 5: print(count) count += 1 Be careful with the condition, because if the condition does not change, then the loop will never stop. This teaches responsibility, as automation without control can cause chaos. Loops must have an exit. Follow the Python 🐍 Starters Hub: WhatsApp: https://lnkd.in/dbjAFv52 LinkedIn: https://lnkd.in/dkJE3tZq Website: https://lnkd.in/eBHB2MqY
To view or add a comment, sign in
-
Python Starters Day 16 Foundation Nugget Boolean enhances thinking Booleans are True or False. Nothing else. Programs run on binary logic. Conditions evaluate to one of two outcomes. 5 > 3 That’s True. Understanding Boolean logic strengthens problem-solving skills, and these skills help in simplifying complex ideas into yes or no questions. Every system decision reduces to a Boolean, even in life. Follow the Python 🐍 Starters Hub: WhatsApp: https://lnkd.in/dbjAFv52 LinkedIn: https://lnkd.in/dkJE3tZq
To view or add a comment, sign in
-
An Expense Tracker in Python is a small program that helps you username, category, amount and manage daily expenses. It usually allows you to: Below is a simple Python Expense Tracker using a menu system. a="\texpense tracker" print(a.title()) username=input("enter the username:") category=input("enter the category:") amount=int(input("enter the amount:")) b="\tsummary" print(b.title()) print("name:",username) print("category name:",category) print("amount spended:",amount) output: Expense Tracker enter the username:Lakshmi enter the category:Food enter the amount:500 Summary name: Lakshmi category name: Food amount spended: 500. Pooja Chinthakayala Mam,Saketh Kallepu Sir,Uppugundla Sairam Sir.
To view or add a comment, sign in
-
Day 8/30 Today I socked my self in study of File Handling in python Main Concept Learned: File Handling in Python means giving your program ability to work with files, there are different file formats such as , CSV,JSON,Text files. This is like working with a diary,you open to read or write and then close it. Opening and Closing Files The basic way to work with files is by using the open() function, using the read mode “r“( opens a file for reading), write mode “w“ (creates file or overwrites an existing one ) and append mode ”a” (opens file and writes at the end of existing file). Context Manager : this a a special way to handle resources that need to be set up and cleaned properly using the “with“ statement. this statement automatically closes the file ,even if an error occurs.
To view or add a comment, sign in
-
-
📘 Python Learning – Lists at a Glance Today I focused on understanding one of the most important data structures in Python — Lists. Here’s a quick snapshot of what I learned: 🔹 What is a List? A list is a collection of items that is ordered, changeable, and allows duplicates. 🔹 Creating a List fruits = ["apple", "banana", "cherry"] 🔹 Accessing Elements fruits[0] # apple fruits[-1] # cherry 🔹 Common List Methods append() → Add item insert() → Add at specific position remove() → Remove item pop() → Remove by index index() → Find position 🔹 List Slicing fruits[0:2] # ['apple', 'banana'] 🔹 List Comprehension (Quick & Powerful) squares = [x**2 for x in range(5)] 💡 Lists are extremely flexible and form the foundation for many data operations in Python. Mastering them is a big step toward becoming confident in programming and data analysis. Muhammad Rafay Shaikh#Python #LearningJourney #DataAnalytics #Programming #YouExcel #WomenInTech #CareerGrowth
To view or add a comment, sign in
-
-
🚀 Day 17 – Python Learning Journey Today I focused on Dictionary Methods in Python 🐍 A dictionary stores data in key–value pairs and is very useful for structured data. 📘 Dictionary Methods I Learned: 🔹 keys() – Returns all keys 🔹 values() – Returns all values 🔹 items() – Returns key-value pairs 🔹 get() – Safely access a value using key 🔹 update() – Update or add new key-value pairs 🔹 pop() – Remove a specific key 🔹 popitem() – Removes last inserted item 🔹 clear() – Removes all items 🔹 copy() – Creates a copy of dictionary 💡 What I Understood: ✔ Keys must be unique ✔ Keys should be immutable ✔ Dictionaries are mutable (can be updated) Learning step by step and improving daily 💪✨ #Python #LearningJourney #Day17 #Dictionary #CodingLife
To view or add a comment, sign in
-
Day 17 of hashtag#30DaysOfCode – Handling Exceptions in Python Today I worked on the concept of Exception Handling by implementing a program to compute the power of a number using a custom class. 🔹 Created a Calculator class with a power(n, p) method to calculate n raised to the power p. 🔹 Implemented exception handling to ensure that both inputs are non-negative. 🔹 If either n or p is negative, the program raises an exception with the message: "n and p should be non-negative". 💡 Key learning: Exception handling helps make programs more robust by managing invalid inputs and preventing unexpected crashes. 📌 Concepts practiced: • Exception handling in Python • Using raise to generate custom exceptions • Class and method implementation • Input validation Daily coding practice is helping me improve my understanding of Python concepts and problem-solving skills. Looking forward to the next challenge! 💻 hashtag#Python hashtag#CodingChallenge hashtag#HackerRank hashtag#ExceptionHandling hashtag#ProblemSolving hashtag#LearningJourney hashtag#30DaysOfCode
To view or add a comment, sign in
-
-
My SQL and Python Journey Day 2 of My Learning Journey – Introduction to Python Today I learned about Single Value Data Types in Python. 🔹 What is a Single Value Data Type? A single value data type can store only one value at a time in a variable. Example: If we store a number like 10 in a variable, that variable contains only one value, not multiple values. In Python, Single Value Data Types are mainly divided into two categories: 1️⃣ Numeric Data Types These store numeric values. Integer (int) Stores whole numbers without decimal points. Examples: 10, -5, 0 Float (float) Stores decimal numbers. Examples: 3.14, 0.5, -2.7 Complex (complex) Stores numbers with real and imaginary parts. Example: 3 + 4j 2️⃣ Boolean Data Type Boolean (bool) Stores only two values: True or False It is mainly used in conditions, comparisons, and decision-making in programs. #Python #PythonLearning #LearningSeries #Programming #CodingJourney #PythonBasics
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