I have a bunch of strings, all on one line, separated by a single space. I would like to store these values in a map, with the first string as the key, and a set of the remaining values. I am trying
map = {}
input = raw_input().split()
map[input[0]] = input[1:-1]
which works, apart from leaving off the last element. I have found
map[input[0]] = input[1:len(input)]
works, but I would much rather use something more like the former
(for example, input is something like "key value1 value2 value3"
I want a map like
{'key' : ['value1', 'value2', 'value3']}
but my current method gives me
{'key' : ['value1', 'value2']}
)