0

How to ask the user for a list as input

2nd Jan 2018, 1:45 PM
Bushra Ali
2 Réponses
+ 3
No other way than "build it". Either as Hatsy suggested - one input and a space as separator or through a loop. Just remember that anyhow all the input() functions will always return a string. So if you want to derive some numerical value from them, you have to convert them each time.
2nd Jan 2018, 2:33 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 4
Take input as string and then split it to list using split(), I guess.
2nd Jan 2018, 1:59 PM
Hatsy Rei
Hatsy Rei - avatar