1#to get integer list
2integer_list = list(map(int, input().split()))
3#to get char or str list, just replace int with str
4str_list = list(map(str, input().split()))
5#syntax of map(): map(dataType, iterable [, iterable2, iterable3,...iterableN])
1
2# For list of integers
3lst1 = []
4
5# For list of strings/chars
6lst2 = []
7
8lst1 = [int(item) for item in input("Enter the list items : ").split()]
9
10lst2 = [item for item in input("Enter the list items : ").split()]
11
12print(lst1)
13print(lst2)
1lst = [ ]
2n = int(input("Enter number of elements : "))
3
4for i in range(0, n):
5 ele = [input(), int(input())]
6 lst.append(ele)
7
8print(lst)
1# Create an empty list
2Elements = list()
3
4# Iterating till the range of elements that has to be input
5for i in range(0, int(input("Enter the number of elements: "))):
6 Elements.append(input("Enter the " + str(i + 1) + " input: ")) # Adding the element to the list
7
8#Printing the list
9print(Elements)
10