Input List From User

[Solved] Input List From User | Lisp - Code Explorer | yomemimo.com
Question : Get a list as input from user

Answered by : krishna-agarwal

# number of elements
n = int(input("Enter number of elements : "))
# Below line read inputs from user using map() function
a = list(map(int,input("\nEnter the numbers : ").strip().split()))[:n]
print("\nList is - ", a)

Source : | Last Update : Sun, 03 Jul 22

Question : reading a list in python

Answered by : cautious-cormorant-z6fnlkwmmrqj

strings = list(map(str,input().split()))
numbers = list(map(int, input().split()))

Source : | Last Update : Wed, 26 Aug 20

Answers related to input list from user

Code Explorer Popular Question For Lisp