Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Contribute
Contribute
Link to Us
Linux Jobs


Top White Papers

More on LinuxToday


Python4Kids: New Tutorial: Variables and Stuff

Jul 16, 2010, 18:36 (0 Talkback[s])
(Other stories by Bre)

[ Thanks to Brendan Scott for this link. ]

"In some of the earlier tutorials I've been using variables without actually explaining what they are. Strict Python-Zen: within Python there are no variables everything is an object*. On the assumption that that is too abstract for you, I will explain it a different way, through the use of containers (like trays and buckets) which, if I'm lucky, will preserve at least a little bit of the Python-Zen.

"Variables allow you to be flexible. They are a way of storing something in the computer, much like having a bucket for putting your Lego in. If you need to go do some chores and just drop your toys, you might not be able to find them again later – or if your parents clean up the toys might get thrown out in the course of garbage collection. If, instead, you get a plastic bucket out and put them in there, you can rest safe in the knowledge that they'll be there later after you finish your chores. Variables are a bit similar."

Complete Story

Related Stories: