Loops in Python (The detailed examples about the Loops in python)

AliKhan325963 17 views 21 slides Aug 31, 2025
Slide 1
Slide 1 of 21
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21

About This Presentation

Loops in Python Challenges


Slide Content

Python Loop Challenges Each Task on a Separate Slide

Task 1: Multiplication Table (Formatted) Print a multiplication table from 1 to 10 using nested loops in a tabular format.

Task 2: Pyramid Pattern Print a pyramid of stars with height as user input.

Task 3: Hollow Square with Diagonals Print a hollow square with diagonals drawn using loops.

Task 4: Prime Numbers in a Range Print all prime numbers between 1 and 100 using loops only.

Task 5: Reverse a Number Input an integer and reverse it without converting to string.

Task 6: Palindrome Check (Number) Check if the number is a palindrome using loops.

Task 7: Sum of Digits Compute the sum of digits of an integer using loops.

Task 8: Count Vowels and Consonants Count vowels and consonants in a given string using loops.

Task 9: Factorial Calculation Find factorial using both for loop and while loop.

Task 10: Fibonacci Series Print the first n Fibonacci numbers using a loop.

Task 11: Pattern: Number Triangle Print incremental number triangle pattern like 1,12,123...

Task 12: Armstrong Numbers in Range Find all Armstrong numbers between 1 and 1000 using loops.

Task 13: GCD and LCM using Loops Compute GCD and LCM of two numbers without built-in functions.

Task 14: Print a Diamond Pattern Print a diamond shape pattern with stars.

Task 15: Sum of Even and Odd Numbers Compute sum of even and odd numbers from 1 to n.

Task 16: Find Largest and Smallest from Inputs Ask user for n numbers and find max and min using loops only.

Task 17: Count Digits Without Conversion Count number of digits in an integer without using str().

Task 18: Pattern with Alphabets Print pattern of alphabets (A, AB, ABC, etc.).

Task 19: Table of a Number with Powers Print powers of a given number in tabular format.

Task 20: Reverse Words in a Sentence Reverse the order of words in a sentence using loops only.
Tags