Write a Python program to generate values from 1 to 10 and then remove all the odd numbers from the list
Answers
Answered by
0
Answer:
Input:
list = [11, 22, 33, 44, 55]
Output:
list after removing ODD numbers
list = [22, 44]
Explanation:
brainly.in/question/45494096?tbs_match=4&answeringSource=greatJob%2FquestionPage%2F1
Answered by
1
Answer:
for i in range(10):
if i%2 == 0:
print(i)
Explanation:
1. % is remainder operator in python
In the first line you are running a for loop 10 times then you are checking if the remainder of i is 0, if its 0 then its even otherwise its odd, so you print the value of i if its even and if it odd then it does nothing
Similar questions