+ 1

How can I make a list taking input from user?

30th Nov 2020, 11:42 AM
Iffat Nishat
Iffat Nishat - avatar
7 Respostas
+ 11
Here is a link to a tutorial that shows some possible solutions you may look for. https://code.sololearn.com/cT9gzxWimqjz/?ref=app if you want to have input of multiple values, you can use a for loop and append the input to a list.
30th Nov 2020, 3:27 PM
Lothar
Lothar - avatar
+ 8
#Try this x = input().split() print(x)
30th Nov 2020, 1:06 PM
Simba
Simba - avatar
+ 5
You can use something like this x = input().split() print(x) This will print an list Or you can try something like this list = [] lenOfList = 5 for i in range(lenOfList): list.append(input()) print(list) This will take a the value one bye one then append them into an list
1st Dec 2020, 11:50 AM
Coder
Coder - avatar
+ 4
Gives Input of all listed values & print them
30th Nov 2020, 11:44 AM
Sâñtôsh
Sâñtôsh - avatar
+ 3
# or shorter yet [*input().split()]
30th Nov 2020, 1:18 PM
Yohanan
+ 2
Thank you guys
30th Nov 2020, 5:00 PM
Iffat Nishat
Iffat Nishat - avatar
+ 1
Can you please explain this with syntax?
30th Nov 2020, 11:55 AM
Iffat Nishat
Iffat Nishat - avatar