Data Types And Variables

Programming Language

DataTypes

There are 3 different data types. These are called Integer, Float and String. They are both different from each other . Also they are used for different things.


Integer

Integer is a whole number. It does not use quotation marks around it or decimal numbers. Integer never uses decimal or negative numbers - only whole numbers. An example of this is: 23


String

String data types include quotation marks around the numbers or letters. It is the only one out of string, integer and float that uses quotation marks, therefore it is easily distinguishable. An example of this is: "hello"


Float

Float data types contain decimal numbers instead of quotation marks and never uses a whole number. An example of this: 26.53

Variables

A variable can be compared to a box - You can put anything in it. In computer science a variable is used for storing things such as values.