How to convert a for loop output to a list?
Try this using list comprehension
>>>[x+y for y,x in zip(range(0,4,1),range(0,8,2))]
[0, 3, 6, 9]
>>>[str(x+y) for y,x in zip(range(0,4,1),range(0,8,2))]
['0', '3', '6', '9']
The easiest way for your understanding, without using list comprehension, is:
mylist = []
for y,x in zip(range(0,4,1),range(0,8,2)):
mylist.append(str(x+y))
print mylist
Output:
['0','3','6','9']