Answers for "HOW TO GET LSIT AS AN INPUT IN PYTHON"

1

HOW TO GET LSIT AS AN INPUT IN PYTHON

# For list of integers
lst1 = []  
  
# For list of strings/chars
lst2 = []  
  
lst1 = [int(item) for item in input("Enter the list items : ").split()]
  
lst2 = [item for item in input("Enter the list items : ").split()]
  
print(lst1)
print(lst2)
Posted by: Guest on June-03-2021

Code answers related to "HOW TO GET LSIT AS AN INPUT IN PYTHON"

Python Answers by Framework

Browse Popular Code Answers by Language