Assignment_ Working With Loops
Assignment_ Working With Loops
Objective:
Example:
# Sample input
Enter a positive integer: 5
# Expected output
The sum of numbers from 1 to 5 is: 15
Example:
# Sample input
Enter a number: 3
# Expected output
3 x 1 = 3
3 x 2 = 6
3 x 3 = 9
3 x 4 = 12
3 x 5 = 15
3 x 6 = 18
3 x 7 = 21
3 x 8 = 24
3 x 9 = 27
3 x 10 = 30
Example:
Example:
# Sample input
Enter a positive integer: 5
# Expected output
The factorial of 5 is: 120
This assignment will help you apply the knowledge of for and while loops in practical scenarios.