+ 1
List input in python
i want to take input of a list from user in a simplest way.i dont want to mention the size of the list to the user.User can insert as many elements as user wants.plzz help!!
3 Réponses
- 1
def lst(*elements):
print(list(elements))
lst(input().split(","))
### copy amd paste the code in playground..and see
## input like this..
### 5,6,7,89,asdf,****
0
but i want to take input of the list elements from user
- 1
def lst(*elements):
print(list(elements))
lst(9,9,9)
lst(3,5,67,89,100)
lst("yoyo",567,"***")
### copy amd paste the code in playground..and see