Thursday, January 30, 2014

3.1.1 Variables

A Variable in a computer can be seen as a bucket( or an envelope) because information can be stored and maintained.
You can think that a variable is like a bucket or an envelope because you can store stuff in a bucket and in a envelope ( just imagine the stuff is data when thinking it as a variable).
The bucket is named after the variable.
 For example bucket = Name
When you are referring to a bucket you use the name of the bucket, not the information stored in it.
for example :
age = 17 (age is the bucket, 17 is the information stored inside of it)
name = Sam (name is the bucket, Sam is the information stored inside of it)
dob= 03/09/1995 (dob is the bucket, 03/09/1995 is the information stored inside of it)

Source :http://python4kids.wordpress.com/2010/07/07/some-foundations-variables-and-stuff/


No comments:

Post a Comment