To do it the way you're trying to do it, use this:
>>> num = 0
>>> mylist = 
>>> while num < 10:
... num += 1
... mylist += [num]
>>> for item in mylist:
... print item
Notice I put brackets around num since you have to add a list to a list when using the + operator. Other methods would be to use mylist.append(num) or mylist.insert(index, num) . I also changed your x = x + y statements to x += y , which is identical.
"I'm not getting it to print anything! I'll post the exact code I am working with... I'm trying to convert from deci to binary and print the binary number using the list method."
so you're trying to convert a number from decimal to binary??
here's a hint how to do that :)
Need some help with this Array. I am trying to get the sum of the even numbers and the sum of the odd numbers using a for each loop. I know the answers to what I am trying to achive are sum of even = 84 and the sum of ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...