Search for question
Question

1. Write a python program that uses a loop to print numbers

from 0 to 100. Then find the sum of these numbers and

display it on the console.

2. Write a python program that uses a loop to print the even

numbers between 0 and 100. Then find the sum of these

numbers and display it on the console.

3. Write a python program that uses a loop to print numbers

from 100 to 0 in descending order. Then find the sum of

these numbers and display it on the console.

4. Write a python program that displays the following pattern

on the console.

5. Write a python program that displays the following pattern

on the console.

[1, 2, 3, 4, 5, 6, 7, 8, 9, 10)

[1, 2, 3, 4, 5, 6, 7, 8, 9)

[1, 2, 3, 4, 5, 6, 7, 81

[1, 2, 3, 4, 5, 6, 71

[1, 2, 3, 4, 5, 61

[1, 2, 3, 4, 51

[1, 2, 3, 4)

[1, 2, 3]

[1, 2]

[1]

6. Write a python program containing the list below. Use a

loop to iterate through the list and display numbers

divisible by 5 and if you find a number greater than 150,

stop the loop iteration.

List=[12,15,32,42,55,75,122,132,150,180,200]

Expected output:

15

55

75

158

7. Write a python program to reverse the following list using a

for loop. Print the result on the console

list1= [10, 20, 30, 40, 50]

Expected output:

8. Write a python program that displays all prime numbers

within the range 25 through 50.

Example:

6 is not a prime number because it can be divided by

numbers are than 1 and itself (2 and 3).

37 is a prime number because it can not be divided by

any number other than 1 and itself.

Expected output:

Prime numbers between 25 and 50 are:

Fig: 1