
-----------------------------------
burmantanya
Wed Oct 08, 2008 6:46 pm

Accumulator
-----------------------------------
Hey Everyone

I have some question about python programming.. i m new to it..willin to learn to my best abilities! Anwers/suggestions will be really appreciated!

- What is an accumulator? what is its purpose ? how does it work ?
- what is index?
- What is the difference between python shell and writer(where u write programs)?

-----------------------------------
Insectoid
Wed Oct 08, 2008 7:09 pm

RE:Accumulator
-----------------------------------
I suppose an index would refer to an element of an array or string. For example, my_array (6) would refer to the 6th index of my_array. Syntax is wrong, I don't know much python. 

a shell is like the command line. It executes as you type (pain in the arse, IMO). a writer/editor will allow you to write the code, save, run, compile, etc. I think.

-----------------------------------
SNIPERDUDE
Wed Oct 08, 2008 8:27 pm

RE:Accumulator
-----------------------------------
That's a pretty good educated guess there insectoid.  Kudos.
I'm not sure about Python either... so I can't help you there, although insectoid gave a pretty good idea of each element.  And yes, shells are annoying.

-----------------------------------
gitoxa
Wed Oct 08, 2008 10:05 pm

RE:Accumulator
-----------------------------------
An accumulator refers to a variable acting as a counter. It keep accumulating (getting larger) until a certain goal is accomplished.

An index, like insectoid said, is a concept for the element in an array.  An index is like an accumulator, where the goal is to search your way through an array (in python, lists, or string variables).

Python comes with a shell that doesn't execute as you type, IDLE.  Well, it does, but it allows you to write out entire structures and finish them, and allows you to edit previously entered lines.
And a writer is just simply a word processor, such as notepad.

-----------------------------------
burmantanya
Sun Oct 12, 2008 12:00 am

RE:Accumulator
-----------------------------------
Thank you guyz
thanx a tonn!!!

-----------------------------------
wtd
Sun Oct 12, 2008 12:44 am

RE:Accumulator
-----------------------------------
Note: interactive interpreters are awesome.

>>> my_list = [1, 2, 3]
>>> accumulator = 0
>>> for x in my_list:
...     accumulator = accumulator + x
...
>>> accumulator
6
>>>
