I am getting input in the form of:
4 11111
I am using a,b = map(int,raw_input().split()) to store 4 in a and 11111 in b.
But I want b to be a list, how am I supposed to do that ?
You can just use list :
>>> list('11111')
['1', '1', '1', '1', '1']
But in that case you can not use map function because it just apply one function on its iterable argument and in your code it convert the whole of '11111' to integer so you have tow way :
b as a list of string ones :inp=raw_input().split() a,b = int(inp[0]),list(inp[1])
map :>>> map(int,'11111') [1, 1, 1, 1, 1]
a, b = map(int, raw_input().strip().split())
char list:
l = list(str(b))
int list:
l = [int(i) for i in str(b)]
l = list(str(b))?a, b = "4 11111".split();a, b = int(a), list(b) will be more efficient.
bto be a list of what?[11111],[1, 1, 1, 1, 1]? And what input are you expecting in general?