Write a Python script to create a list of first N even natural numbers.

 #Write a Python script to create a list of first N even natural numbers.

list=[]
num=int(input("Enter the numbers:"))
for i in range(1,num):
    if i%2==0:
        list.append(i)
 
print(list)
print(type(list))

   

Comments

Popular posts from this blog

Write a python script to display the current date and time. First create variables to store date and time, then display date and time in proper format (like: 13-8-2022 and 9:00 PM """