Wednesday, October 26, 2016

Lesson 1.0 - Variables

Today's lesson is on Variables.
The concept of variables are in every general purpose programming language. Think of variables as buckets that contain things. They can contain anything from integers to letters to words to anything you can imagine, oh yeah anything.

Variables are usually design to take one thing at a time though.
eg: myNiceVariable = 43;
This myNiceVariable here is housing the value 43 which is an Integer.

Variables are also defined by their type for example, you  can say ... hey, see that variable, its an integer variable, or a string or character, decimal etc ... We will get to variable types shortly
From the above example, however, myNiceVariable is an integer variable

The type of variable determines what can be stored in it.

You can give your variable any name of your choice just let it be reasonably short and sensible

myName = "Kojo Yaw Osei"
This is a string variable ( I guess they call it string because its a string of characters(letters) put together)

niceDecimalNumber = 4.32
This is a decimal variable

>>NEXT LESSON

No comments:

Post a Comment