Thanks to all that helped on this one.
I missed in my reading that you can address an element of a list as
y[i]. Going back through "Think Python" book, they have one example of
it. And spend 1/4 page out of the 263 pages in the book. They spend much
more time on other parts of lists like slices
Kipton Moravec wrote:
> I am new to Python, and I do not know how to traverse lists like I
> traverse arrays in C. This is my first program other than "Hello World".
> I have a Raspberry Pi and they say Python is the language of choice for
> that little machine. So I am going to try to learn it.
>
On 02/02/2014 09:46 PM, Kipton Moravec wrote:
I am new to Python, and I do not know how to traverse lists like I
traverse arrays in C. This is my first program other than "Hello World".
I have a Raspberry Pi and they say Python is the language of choice for
that little machine. So I am going to t
On Sun, Feb 02, 2014 at 02:46:38PM -0600, Kipton Moravec wrote:
> I am new to Python, and I do not know how to traverse lists like I
> traverse arrays in C.
You can do this, but normally shouldn't:
data = [2, 4, 8, 16, 32]
for i in range(0, len(data)):
x = data[i]
print(x)
That is a mor
Kipton Moravec Wrote in message:
> I am new to Python, and I do not know how to traverse lists like I
> traverse arrays in C. This is my first program other than "Hello World".
> I have a Raspberry Pi and they say Python is the language of choice for
> that little machine. So I am going to try to
Kind of sure this is the translation line for line:
#We define some vars before utilizing them x,and y are list comprehension
# You said int for x, so it's created in ints, and y is in floats
x = [num for num in range(0,496)]
# You said double for y, so the it's created in floats, and x is an int
On Sun, Feb 2, 2014 at 6:44 PM, David Hutto wrote:
>
>
>
> On Sun, Feb 2, 2014 at 3:46 PM, Kipton Moravec wrote:
>
>> I am new to Python, and I do not know how to traverse lists like I
>> traverse arrays in C. This is my first program other than "Hello World".
>> I have a Raspberry Pi and they s
On Sun, Feb 2, 2014 at 3:46 PM, Kipton Moravec wrote:
> I am new to Python, and I do not know how to traverse lists like I
> traverse arrays in C. This is my first program other than "Hello World".
> I have a Raspberry Pi and they say Python is the language of choice for
> that little machine. So
I am new to Python, and I do not know how to traverse lists like I
traverse arrays in C. This is my first program other than "Hello World".
I have a Raspberry Pi and they say Python is the language of choice for
that little machine. So I am going to try to learn it.
I have data in the form of x,