Different Data Types

By Georgia rae sterling - grant

What is a variable?

A variable stores data and when it's given a command like print, add and times it will display what data is stored in a form of what is commanded. Such as:


>>> first_name = "georgia rae"

>>> surname = " sterling grant"

Once I have write that in it means "georgia rae" + " sterling grant" is stored.


>>> print first_name + surname

georgia rae sterling grant

The command asked was to print: add the first name and the surname together to make the full name.


What is a string?

A string is when you have characters in speech marks. Such as:


"hello"

That would be called a spring.

What is a integer?

Integer is short for int. A integer is a whole number. Such as:


4

This number can be printed, added, subtracted and divided also by a integer.

What is a float?

A float is a decimal number. Such as:


0.4

This number can also be printed, added, subtracted and divided.