Python practice 🚀 Day 2 of My Python Learning Journey: Today I explored Generator Expressions in Python and how they differ from list comprehensions. Example: numbers = [1,2,3,4] g = (x*x for x in numbers) print(list(g)) print(list(g)) Output: [1, 4, 9, 16] Output: [] Generator expressions create values one at a time unlike list unless you explicitly typecast it as list while printing, making them memory efficient. once a generator is fully consumed, it becomes exhausted, which is why the second print returns an empty list. 💡 Insight here is that generators are very useful when working with large datasets or streaming data, where storing everything in memory is not practical. #Python #Learning #DataScience
Python Generator Expressions vs List Comprehensions
More Relevant Posts
-
I spent weeks compiling my Python learning journey into one place. Covers everything in order: What is Python , Variables ,Data Types, Loops ,Functions ,OOP, Decorators ,Generators,Regex and much more. Drop a "Python" in the comments and I will send you the complete PDF. If you find it helpful, share it with someone who's starting their coding journey. #Python #Programming #Learning #PythonNotes #CodingJourney Krishan Narula AI ML, Gen AI
To view or add a comment, sign in
-
🚀 Day 1: Learning Python Input & Output Today I learned how Python takes input and shows output. 📌 Example: name = input("Enter your name: ") print("Hello", name) 📌 Output: Enter your name: Namitha Hello Namitha 💡 What I understood: - input() is used to take user data - print() is used to display output 🧠 Practice: Try taking your age as input and print it. #Python #CodingJourney #LearnPython #Beginners
To view or add a comment, sign in
-
-
Still writing long loops in Python? If you’re learning Python, you’ve probably seen Lambda, Map, Filter, and Reduce, but understanding when to use them is the real game 👇 ⚡ Lambda → Small, anonymous one-line function 🔁 Map → Apply a function to every item 🎯 Filter → Select only what you need ➕ Reduce → Combine everything into one result 💡 Think of it like this: Lambda = Action | Map = Transform | Filter = Select | Reduce = Combine Master these, and your code becomes cleaner, shorter, and more powerful🚀 Keep learning. Keep building. Learn Python Step by Step With Shukry 💻 #Python #Programming #Coding #SoftwareDevelopment #Developers #LearnPython #AI #MachineLearning #Tech
To view or add a comment, sign in
-
-
🚀Day 4/30 – Python Learning Challenge 🐍 Today I explored Operators in Python — the symbols that allow us to perform operations on variables and values. Python provides several types of operators that make coding more powerful and efficient. 🔹 Arithmetic Operators – Used for mathematical calculations + - * / % // ** 🔹 Comparison Operators – Used to compare two values == != > < >= <= 🔹 Logical Operators – Used to combine conditional statements and or not 🔹 Assignment Operators – Used to assign values to variables = += -= *= /= 📌 Key Learning: Operators are the backbone of writing logic in Python. Mastering them helps in building conditions, calculations, and decision-making in programs. Learning something new every day and staying consistent with my 30-Day Python Challenge. 🚀 #Python #PythonLearning #CodingJourney #LearnInPublic #DataScience #Programming #100DaysOfCode
To view or add a comment, sign in
-
-
Day 10 of my 90-Day Python Learning Challenge 🐍 Today I learned how to take user input in Python and how type casting works. This is an important concept because it allows programs to interact with users and convert data into the required type. What I learned today: • How to take input using the "input()" function • Understanding that "input()" returns data as a string by default • Converting data types using type casting (int(), float(), str()) • Writing small programs that take input from users and perform operations Here is a small example I practiced: name = input("Enter your name: ") age = int(input("Enter your age: ")) print("Hello", name) print("Next year your age will be:", age + 1) Learning how to take input from users makes programs more interactive and practical. Step by step, I’m building stronger Python fundamentals. Day 10/90 — Consistency is the key to growth 🚀 #Python #90DaysOfCode #LearningInPublic #CodingJourney #Programming
To view or add a comment, sign in
-
-
🚀 Learn Python – Sets If you want to learn how to handle unordered, unique collections of data, mastering Sets in Python is essential. They are the ultimate tool for automatic duplicate removal. I’ve created a structured learning section on my website that explains sets step-by-step with practical examples. 📚 Explore the tutorial: https://lnkd.in/g7pykaF9 🔹 What you will learn • Creating sets with curly braces {} and the set() function • Automatic duplicate removal for data cleaning • Understanding unordered and unindexed collections • Making empty sets correctly (set() vs {}) • Use cases: Mathematical operations and unique value filtering This resource is designed to help developers learn Python with practical examples and structured lessons. Happy Learning! 🚀 #Python #Coding #DataScience #LearnPython #Programming #PythonBasics
To view or add a comment, sign in
-
🚀 Python Learning Update Today, I revised concepts related to File Handling and List Comprehension in Python. Here’s what I focused on: ✅ File handling operations (open(), read(), write(), append()) ✅ Working with different file modes (r, w, a) ✅ Using with open() for better file management ✅ Writing concise and efficient code using list comprehension ✅ Applying conditions inside list comprehension This revision helped me improve both data handling and code optimization skills. Step by step, building stronger problem-solving ability 💪 #Python #LearningJourney #FileHandling #ListComprehension #Coding #KeepLearning
To view or add a comment, sign in
-
🚀 Python Learning Journey Today’s learning was exciting! I explored some core concepts in Python 🐍 ==> Input & Output – Taking user input and displaying results ==> String Manipulation – Working with text (like slicing, formatting, and modifying strings) It’s amazing to see how programs can interact with users and process data in simple ways. Small concepts, but powerful building blocks for real-world applications. 💭 What I’m learning: Step by step, I’m getting more comfortable with coding and problem-solving. Looking forward to building mini projects soon! If you have suggestions or beginner-friendly challenges, I’d love to hear them 🙌 I request to you, kindly comments your suggestions and tips. #Python #LearningInPublic #CodingJourney #BeginnerProgrammer #Upskilling #TechJourney
To view or add a comment, sign in
-
-
🚀 Python Learning Journey – Day 25 Today, I revised Day 15 and Day 16 topics to strengthen my understanding. Here’s what I focused on: ✅ Revisiting key concepts and syntax ✅ Practicing previously learned programs ✅ Improving code clarity and logic building ✅ Strengthening confidence in fundamentals Revision helped me identify small mistakes and improve my problem-solving approach. Consistency and revision are helping me grow step by step 💪 #Python #LearningJourney #Revision #Consistency #Coding #Day25 #KeepLearning
To view or add a comment, sign in
-
Built a real-time Countdown Timer using Python. As part of improving my Python fundamentals, I created a timer that updates on the same line instead of printing multiple lines. This program: • Takes time input in seconds • Updates the countdown in real time • Uses time delay to simulate an actual timer • Displays the result cleanly without cluttering the output While building this, I learned: – How time.sleep() controls execution – How \r helps overwrite output on the same line – How small changes improve user experience It’s a simple project, but it helped me understand how programs can simulate real-time behavior. Still learning and improving step by step. #Python #BeginnerProject #CountdownTimer #LearningInPublic #CodingJourney
To view or add a comment, sign in
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
👍 cool