A collection of beginner-to-intermediate Python programs focused on mastering loops, nested loops, pattern printing, functions, string manipulation, and algorithmic thinking.
This assignment emphasizes understanding the logic behind iteration, rather than simply memorizing syntax. Every problem is implemented using appropriate looping techniques (for and while) and demonstrates multiple approaches wherever applicable.
This repository contains solutions to fundamental Python programming exercises covering:
- Loop control (
for&while) - Nested loops
- Star pattern printing
- Functions
- Mathematical algorithms
- String processing
- Basic problem-solving techniques
The goal of this assignment is to build a strong foundation in iteration and develop logical thinking required for Data Structures & Algorithms, Automation, Data Analysis, and Software Development.
- Print output on the same line
end=""parameterwhileloop fundamentalsforloop fundamentals
- Using
forloop - Using nested loops
- Using
forloop - Using nested loops
- Using string multiplication
- Using nested loops
- Space and star alignment logic
- Using
forloop - Using
whileloop
- Using
forloop - Using reverse
whileloop
- Using
forloop - Using
whileloop - Handling uppercase and lowercase characters
- Using
split() - Comparing word lengths
- First N Fibonacci numbers
- Using
forloop - Using
whileloop - Understanding variable shifting (
a,b,next_num)
Assignment-5/
โ
โโโ Loop Basics
โ โโโ Same Line Output (while)
โ
โโโ Pattern Printing
โ โโโ Right Triangle
โ โโโ Reverse Right Triangle
โ โโโ Pyramid
โ โโโ Nested Loop Patterns
โ
โโโ Factorial
โ โโโ With Function
โ โโโ Without Function
โ โโโ For Loop
โ โโโ While Loop
โ
โโโ String Programs
โ โโโ Count Vowels
โ โโโ Longest Word
โ
โโโ Fibonacci Series
โโโ For Loop
โโโ While Loop
forloopswhileloops- Nested loops
- Loop counters
- Conditional statements (
if,else) - String indexing
- String methods
split()len()- Functions
- Return statements
- Variable updates
- Pattern logic
- Mathematical algorithms
After completing this assignment, you will be able to:
- Understand the difference between
forandwhileloops. - Solve pattern-printing problems using nested loops.
- Build mathematical algorithms using iteration.
- Traverse strings efficiently.
- Write reusable functions.
- Apply logical thinking to programming problems.
- Strengthen problem-solving skills for coding interviews.
- Print numbers in the same line
- Right triangle pattern
- Reverse triangle pattern
- Pyramid pattern
- Factorial using loops
- Factorial using functions
- Count vowels in a string
- Find the longest word in a sentence
- Generate Fibonacci sequence
- Python Fundamentals
- Iteration
- Nested Iteration
- Pattern Programming
- String Processing
- Algorithm Design
- Logical Thinking
- Clean Code Practices
- Python 3.x
- VS Code
Ankit Rai
Aspiring SQL Developer | Data Analyst
Currently learning:
- Python
- SQL
- Power BI
- Excel
- Data Analytics
โญ If you found this repository useful, consider giving it a Star.