0

Is it possible to get input inside a list in python?

1st Dec 2018, 10:05 AM
Josephine Gitanjali
Josephine Gitanjali - avatar
2 Answers
+ 1
In Python? Indirectly: x = input() stuff.append(x) Directly: stuff.append(input())
1st Dec 2018, 11:08 AM
HonFu
HonFu - avatar
+ 1
Maybe...? inputs=[input() for _ in range(3)] print(inputs) Input: a b c Output: ['a', 'b', 'c']
1st Dec 2018, 5:13 PM
Kirk Schafer
Kirk Schafer - avatar