how to get list input in python code example
Example 1: change list to int in python
test_list = list(map(int,test_list))
Example 2: get list input from user in python
a = list(map(int,input("\nEnter the numbers : ").strip().split()))
Example 3: how to get user inout in python
test = input()
test = input("Please enter your information: ")
test = int(input("Please enter your information: "))
Example 4: get list as input
integer_list = list(map(int, input().split()))
str_list = list(map(str, input().split()))
Example 5: how to get user input of list in python
n = int(input("Enter number of elements : "))
a = list(map(int,input("\nEnter the numbers : ").strip().split()))[:n]
print("\nList is - ", a)