Program to generate values from 1 to 10 and then remove all the odd numbers from the list | Python

Опубликовано: 05 Август 2026
на канале: Educrawl
673
10

#educrawl #education #python #practicals

Write a program to generate values from 1 to 10 and then remove all the odd numbers from the list.

AIM:

To create a program to generate values from 1 to 10 and then remove all the odd numbers from the list.
SOURCE CODE:
num1=[]
for i in range(1,11):
num1.append(i)
print("Numbers from 1 to 10.....\n",num1)
for j, i in enumerate(num1):
if(i%2==1):
del num1[j]
print("The values after removed odd numbers.....\n",num1)

RESULT:
Thus the above program is executed and the required output is obtained.