🐍 Day 6 of My 30-Day Python Learning Challenge Today I learned about Functions in Python. 📌 What is a Function? A function is a reusable block of code that performs a specific task. It helps make programs cleaner, modular, and easier to maintain. 📌 Basic Syntax def greet(name): print("Hello", name) greet("Python") Output: Hello Python 📌 Function with Return Value def add(a, b): return a + b result = add(5, 3) print(result) Output: 8 💡 Functions reduce repetition and make large programs easier to manage. 📊 Quick Question What will be the output? def func(x): return x * x print(func(4)) Answer tomorrow in the comments. #Python #CodingJourney #Programming #LearningInPublic #SoftwareDeveloper
Python Functions: Reusable Code Blocks
More Relevant Posts
-
🚀 Learning Python – List Operations Made Simple! Today, I practiced a basic yet important concept in Python — list concatenation. 🔹 I combined two lists using the + operator: alist = ['praveen','ajay','san','kiran','chandru','fun','joy','rrrr'] blist = ['run','jun','jam'] clist = alist + blist print(clist) ✅ Output: A single list containing elements from both lists. 💡 Key Takeaways: The + operator helps merge lists easily It creates a new list without modifying the original ones Order of elements is maintained 📌 Small steps like these help build a strong foundation in Python programming. #Python #Learning #DevOps #Programming #CodingJourney #Beginners #Automation
To view or add a comment, sign in
-
My Python Journey: Lists + Loops Today, I focused on building a strong foundation in Python with lists and loops. I practiced 10 essential problems, including: 🔹Printing all elements of a list 🔹Accessing elements at even indices 🔹Filtering even numbers 🔹Finding numbers greater than a threshold 🔹Calculating the sum of all elements (without sum()) 🔹Counting total elements (without len()) 🔹Counting numbers greater than 5 🔹Finding the smallest number (without min()) 🔹Printing a list in reverse (using loops) 🔹Creating a new list with squares of numbers 💡 Key takeaways: Loops are powerful for iteration and data manipulation Conditional checks inside loops make Python very flexible Practicing manually (without built-ins) strengthens problem-solving skills. Here’s a glimpse of my list of numbers I practiced on: nums = [14, 13, 27, 34, 20, 16, 23, 82, 49, 83] Feeling confident and ready for Day 2 challenges! 🔥 #Python #DataAnalytics #CodingJourney #100DaysOfCode #LearningByDoing #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 26 of Python Problem Solving!! Today, I worked on a Python problem to check whether two strings are anagrams of each other. 💡 What I Practiced Today: Understanding how to compare two strings efficiently Using dictionaries (hashmaps) for character frequency counting Applying the sorting technique as an alternative approach Analyzing time complexity of different solutions Handling edge cases like unequal string lengths 🧠 Problem Statement: Given two strings s and t, return true if they are anagrams, otherwise return false. 📌 Example: Input: s = "apple", t = "aplep" Output: true ✨ I explored two approaches: 1️⃣ Using dictionaries to count character frequencies 2️⃣ Using sorting to directly compare both strings This problem helped me understand how different approaches can solve the same problem with varying efficiency — a key concept for coding interviews. #Day26 #100DaysOfCode #Python #CodingJourney #ProblemSolving #DataStructures #Programming #LearnToCode #TechJourney
To view or add a comment, sign in
-
-
Day 1 — Starting My Python Journey Today I practiced the basics of Python 🔹 Working with variables 🔹 Using the print() function 🔹 Performing basic operations Here’s a simple snippet I tried: name = "Ankaj" age = 34 print(name, age) a = 20 b = 10 print(a + b) # Addition print(a - b) # Subtraction print(a / b) # Division What I learned: Python makes it really easy to work with variables and perform operations without complex syntax. I’m documenting my journey as I learn every day Follow Ankaj Python Hub to grow with me https://lnkd.in/g3ayfy7M #Python #LearnPython #CodingJourney #100DaysOfCode #Beginner
To view or add a comment, sign in
-
Day 1 — Starting My Python Journey Today I practiced the basics of Python 🔹 Working with variables 🔹 Using the print() function 🔹 Performing basic operations Here’s a simple snippet I tried: name = "Ankaj" age = 34 print(name, age) a = 20 b = 10 print(a + b) # Addition print(a - b) # Subtraction print(a / b) # Division What I learned: Python makes it really easy to work with variables and perform operations without complex syntax. I’m documenting my journey as I learn every day Follow Ankaj Python Hub to grow with me https://lnkd.in/gx2yF2vF #Python #LearnPython #CodingJourney #100DaysOfCode #Beginner
To view or add a comment, sign in
-
Here i learning more interesting things in Python Understanding Loops in Python (Simple Way) Today I learned about loops and how they save time ⏳ 👉🏻 Instead of writing code multiple times, we use loops. Example using while loop: ```python i = 1 while i <= 5: print("Hello", i) i += 1 ``` 📌 Output: Hello 1 Hello 2 Hello 3 Hello 4 Hello 5 💡 Key Learning: Loops help automate repetitive tasks efficiently. Small concept, big impact 🚀 #Python #Loops #Coding #Programming #Learning
To view or add a comment, sign in
-
Today’s focus was on working with lists and improving problem-solving using Python. I practiced different list operations and real-world scenarios to better understand how data can be handled efficiently. Here’s what I worked on: • Reversing a list • Finding common elements between two lists • Extracting unique elements • Removing duplicates while preserving order • List concatenation and repetition • Removing elements based on index conditions • Inserting elements into a list • List comprehensions (squares, even numbers, word lengths) This session helped me get more comfortable with list manipulation and writing cleaner, more efficient Python code using comprehensions. Step by step, improving logic and coding confidence. Big thanks to VASU KUMAR PALANI and PythonLife for the continuous guidance and support. #Python #CodingJourney #LearnInPublic #PythonLists #Programming #100DaysOfCode #Consistency #TechSkills
To view or add a comment, sign in
-
-
Built my first Python mini-project! Over the past few days, I’ve been consistently learning Python fundamentals and applying them through small projects. I recently built a Number Guessing Game where the program generates a random number and the user tries to guess it within limited attempts. While building it, I practiced concepts like: • Functions • Conditional logic • Loops • Exception handling (try–except) • Improving program robustness I also created an improved version that handles invalid input and allows the user to play again. This is just the beginning of my journey as I continue learning Python, problem solving, and eventually AI/ML. You can check out the project here: [https://lnkd.in/gx4NtndT] Looking forward to building more projects and improving step by step. #Python #Programming #LearningInPublic
To view or add a comment, sign in
-
🧠 GATE DA Aspirants — Quick Python Check! Today’s focus: Python Practice Many questions look straightforward… but small details in Python can completely change the answer. Understanding behavior > memorizing syntax. 🎯 Test yourself: https://lnkd.in/gFnfgGaA Consistent practice is key to mastering programming for GATE DA. #GATEDA #Python #Programming #DataScience #Learning #MindSpanEducation
To view or add a comment, sign in
-
-
Built a simple Dice Roller using Python. As part of practicing Python basics, I created a small program that simulates rolling a dice. This program: • Generates a random number between 1 and 6 • Allows the user to roll multiple times • Uses loops and user input for interaction Through this project, I practiced: • Random module • Loops • Conditional statements • Handling user input It’s a simple project, but it helped me understand how randomness and control flow work together. Still learning and building step by step. #Python #BeginnerProject #DiceRoller #LearningInPublic #CodingJourney
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