ASSIGNMENT
COMPUTER SCIENCE
1. Write a loop to print all the elements of a list.
2. Use a loop to calculate and print the sum of all numbers from 1 to 100.
3. Write a program using a loop to print the multiplication table of 5.
4. Create a program that uses a loop to count the number of vowels in a given string.
5. Write a loop to print the even numbers between 1 and 50.
6. Use a loop to iterate through a list of numbers and print out only the numbers greater
than 10.
7. Create a for loop that prints a pattern of stars
*
**
***
****
*****
8. Write a program to calculate the factorial of a given number using a loop.
9. Use a loop to find the maximum value in a list of numbers.
10. Write a program that takes a list of integers and creates a new list with the squares of
those integers using a loop.
11. Write a program that finds the prime numbers between 1 and 100 using a loop.
12. Use a loop to reverse a given string and print the reversed string.
13. Write a program that uses a loop to generate the Fibonacci series up to a certain
number.
14. Create a loop to iterate through two lists of equal length and print their
corresponding elements side by side.
15. Use a loop to print the numbers from 1 to 50, but skip every number divisible by 5.
16. Write a loop to print the first 10 elements of an arithmetic sequence with a common
difference of 3.