How to add elements to the list
Source code for python
WAP a program to add elements to a list.
print("Enter the nos. to be added into the list")
num1=input()
num2=input()
num3=input()
num4=input()
print("The list is ")
numbers=[int(num1),int(num2),int(num3),int(num4)]
print(numbers)
---------------------------------------------------------------------------------------------------------------------------
Terms explanations
num1,num2,num3,num4 ///// They are the variables name.
numbers // IT is the list name.
Comments
Post a Comment