use*_*478 12 python list raw-input python-2.7
所以我raw_input作为一些列表的输入.
x= raw_input()
Run Code Online (Sandbox Code Playgroud)
我输入的地方1 2 3 4
如果我只输入数字,我将如何将其转换为整数列表?
sha*_*aan 22
像这样:
string_input = raw_input()
input_list = string_input.split() #splits the input string on spaces
# process string elements in the list and make them integers
input_list = [int(a) for a in input_list]
Run Code Online (Sandbox Code Playgroud)