Day 16 of my #100DaysOfCode challenge 🚀 Today I worked on a Python program to print a diamond pattern using stars (*). The goal was to understand nested loops, pattern logic, and spacing techniques in Python. What the program does: • Takes the number of rows as input • Prints the upper half of the diamond • Prints the lower half of the diamond • Uses spaces and stars to create a symmetric pattern How the logic works: 1)A function print_diamond(n) is defined 2)The first for loop prints the upper part of the diamond – Spaces are printed using ' ' * (n - i - 1) – Stars are printed using '*' * (2 * i + 1) 3)The second for loop prints the lower part – It runs in reverse order – The same spacing and star logic is applied Key learnings from Day 16: – Understanding pattern-based logic – Working with nested loops – Controlling spacing and alignment – Strengthening logical thinking #100DaysOfCode #Day16 #Python #PythonProgramming #PatternProgramming #LogicBuilding #CodingPractice #ProblemSolving #LearnByDoing #ComputerScience #BTech #CSE #AIandML #VITBhopal #TechJourney
Python Diamond Pattern Program #100DaysOfCode Day 16
More Relevant Posts
-
Learn the basics of Wave Print in Python with ease Discover how Wave Print in Python is used to display text with decorative borders Understand the concept of Wave Print and its applications in the IT industry Read the full article 👉 https://lnkd.in/d4KUHA6J #PythonForBeginners #ITJobsearch #WebDevelopment #LearnPython #ProgrammingTutorials #TechLab Code. Learn. Build. — TechLab by Neeraj
To view or add a comment, sign in
-
Day 17 of my #100DaysOfCode challenge 🚀 Today I worked on a Python program to count the number of vowels and consonants in a given string. The goal was to practice string traversal and character classification. What the program does: • Takes a string input from the user • Converts the string to lowercase for consistency • Checks each character individually • Counts vowels and consonants separately • Returns both counts How the logic works: A function count_vowels_consonants(string) is defined Two strings are created: – One containing all vowels (aeiou) – One containing all consonants Two counters are initialized to 0 The program loops through each character in the string If the character is in the vowel string, vowel count increases If the character is in the consonant string, consonant count increases The function returns both counts Example: Input: my name is SATISH KUMAR Output: Vowels: 7 Consonants: 12 Key learnings from Day 17: – Iterating through strings – Using conditional statements effectively – Handling case sensitivity with .lower() – Strengthening basic string manipulation skills #100DaysOfCode #Day17 #Python #PythonProgramming #StringManipulation #ProblemSolving #CodingPractice #LogicBuilding #LearnByDoing #ComputerScience #BTech #CSE #AIandML #VITBhopal #TechJourney
To view or add a comment, sign in
-
-
Day 4/100: Randomness and Data Structures in Python! Today was an exciting day! I shifted from simple variables to Lists, which allowed me to manage collections of data efficiently. I also explored how to make programs unpredictable using the Random module. What I mastered today: The random Module: Generating random integers and floats to create dynamic experiences. Python Lists: Learning how to store, access, and organize data. List Methods: Mastering .append() to add items and .extend() to combine lists. Offset & Indexing: Accessing specific items (and avoiding the famous "Index Out of Range" error!). Daily Project: Rock Paper Scissors Game I built a fully functional Rock Paper Scissors game where the user plays against the computer. It was a great way to combine if-else logic with random.randint(). Check out my code and progress here: https://lnkd.in/eYp3jYs7 #Python #100DaysOfCode #DataStructures #CodingJourney #RockPaperScissors #Programming
To view or add a comment, sign in
-
-
𝗪𝗲𝗲𝗸 𝟯 of my 𝗗𝗮𝘁𝗮 𝗦𝗰𝗶𝗲𝗻𝗰𝗲 & 𝗠L program with ParoCyber wrapped up with two solid labs on Python operators and string methods. We covered a lot of ground on arithmetic, comparison, logical, assignment, bitwise, membership, and identity operators. Each one serves a specific purpose in how Python reads and evaluates data. 💡The operators '𝙞𝙨' vs '==' were a good reminder that two values can be equal without pointing to the same object in memory. The second lab focused on string methods like split(), join(), replace(), and more. 💡One thing that stuck: strings in Python are 𝗶𝗺𝗺𝘂𝘁𝗮𝗯𝗹𝗲. Any operation returns a new string, not a modified original. Small detail, but it matters. To see the full breakdown, it's all documented on my GitHub. Link below. 🔗 https://lnkd.in/dVnTd3jS #DataScience #Python #MachineLearning #ParoCyber #LearningInPublic #CareerGrowth #WomenInTech
To view or add a comment, sign in
-
🚀 Solved Today’s POTD (23 Feb 2026): Union of Arrays with Duplicates on GeeksforGeeks using Python 🐍 Problem: Given two arrays, return the union of both arrays containing only distinct elements. Approach: Used Python’s Set data structure: • Converted both arrays into sets (automatically removes duplicates) • Used set union operation to combine elements • Returned the result as a list This problem reinforced the importance of choosing the right data structure for cleaner and more efficient solutions. 💡 Time Complexity: O(n + m) Small problems, strong fundamentals 💪 Consistency continues! #day8 #geekstreak60 #npci #geeksforgeeks #dsa #python #learning #problemsolving #codingjourney
To view or add a comment, sign in
-
-
🚀 Day 3 of Learning Python Today was all about writing smarter and more efficient code: ✅ `filter()` function ✅ `lambda` functions ✅ `return` statement The `filter()` function helped me understand how to extract specific data from a list based on conditions. With `lambda` functions, I learned how to write short, one-line functions — super useful for quick operations without defining full functions. And the `return` statement showed me how functions give back results, making them reusable and powerful. Each concept is small on its own, but together they really change how you think about problem-solving in code. Staying consistent and building every day 💪 #Python #CodingJourney #LearningInPublic #100DaysOfCode #TechSkills #StudentDeveloper
To view or add a comment, sign in
-
🚀 30 𝐃𝐚𝐲𝐬 𝐨𝐟 𝐏𝐲𝐭𝐡𝐨𝐧 — 𝐃𝐚𝐲 #16 | 𝐋𝐢𝐬𝐭 𝐅𝐮𝐧𝐜𝐭𝐢𝐨𝐧𝐬 & 𝐌𝐞𝐭𝐡𝐨𝐝𝐬 Day 16 was focused on exploring list functions and methods that make working with lists more efficient and powerful. After understanding the basics of lists, I learned today that Python provides built-in methods to easily modify, manage, and analyze list data. 📌 𝐖𝐡𝐚𝐭 𝐈 𝐂𝐨𝐯𝐞𝐫𝐞𝐝: 🔹 Adding elements using 𝐚𝐩𝐩𝐞𝐧𝐝() and 𝐢𝐧𝐬𝐞𝐫𝐭() 🔹 Removing elements with 𝐫𝐞𝐦𝐨𝐯𝐞() and 𝐩𝐨𝐩() 🔹 Sorting lists using 𝐬𝐨𝐫𝐭() 🔹 Reversing lists with 𝐫𝐞𝐯𝐞𝐫𝐬𝐞() 🔹 Counting occurrences using 𝐜𝐨𝐮𝐧𝐭() 🔹 Finding element positions with 𝐢𝐧𝐝𝐞𝐱() Learning these methods made it clear how Python simplifies operations on data collections. 💡 𝐊𝐞𝐲 𝐓𝐚𝐤𝐞𝐚𝐰𝐚𝐲: Built-in list methods save time and make code cleaner by handling common operations efficiently. Day 16 complete ✅ Each new concept is making Python feel more powerful and intuitive. 💻✨ #Python #30DayChallenge #Day16 #PythonLists #ListMethods #CodingJourney #LearnToCode #Programming #TechGrowth #Consistency
To view or add a comment, sign in
-
-
🚀 Day 3 of Learning Python Today was all about writing smarter and more efficient code: ✅ `filter()` function ✅ `lambda` functions ✅ `return` statement The `filter()` function helped me understand how to extract specific data from a list based on conditions. With `lambda` functions, I learned how to write short, one-line functions — super useful for quick operations without defining full functions. And the `return` statement showed me how functions give back results, making them reusable and powerful. Each concept is small on its own, but together they really change how you think about problem-solving in code. Staying consistent and building every day 💪 #Python #CodingJourney #LearningJourney#30DaysOfCode #TechSkills #Deeper Learning # Leet code
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