How To | Insert Elements in list | Python Program

Insert elements in list from user:-

 Tips: 

1.Take size of the list.
2.Use for loop.
3.Take elements from user.
4.Insert elements in list. 

Code:

n=int(input("Enter the list size:"))

a=[]

for i in range(n):

    i=input()

    a.append(i)

print(a)


Output:

 




Comments

Popular posts from this blog

TOP 10 PROGRAMMING LANGAUAGES COMMING 2021 | ARTICLE

Write a C-program to swap two number:

Print Fibonacci Series using Recursion | C program :