Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Accumulator
Index -> Programming, Python -> Python Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
burmantanya




PostPosted: Wed Oct 08, 2008 6:46 pm   Post subject: 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)?
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Wed Oct 08, 2008 7:09 pm   Post subject: 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




PostPosted: Wed Oct 08, 2008 8:27 pm   Post subject: 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




PostPosted: Wed Oct 08, 2008 10:05 pm   Post subject: 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




PostPosted: Sun Oct 12, 2008 12:00 am   Post subject: RE:Accumulator

Thank you guyz
thanx a tonn!!!
wtd




PostPosted: Sun Oct 12, 2008 12:44 am   Post subject: RE:Accumulator

Note: interactive interpreters are awesome.

code:
>>> my_list = [1, 2, 3]
>>> accumulator = 0
>>> for x in my_list:
...     accumulator = accumulator + x
...
>>> accumulator
6
>>>
Display posts from previous:   
   Index -> Programming, Python -> Python Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: