Step 2 - Data Types
- Coding GP Team Project
- Oct 14, 2020
- 2 min read
Don't get intimidated by the title, it's really simple!

First of all, there is something called a variable, it's like a box that you label and put stuff into. You assign a variable, by using the "=" sign In programming languages, there are multiple types of data to put in a variable. Like the box aka variable "Toys" which has all the toys within it.

There are four rules to remember for variables:
A variable name must start with a letter or the underscore character.
A variable name cannot start with a number.
A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
Variable names are case-sensitive (age, Age and AGE are three different variables)
There are various data types in coding; however, we will focus on the main four: String, Boolean, Integer and Float. So let's explain each of them!
String: A sequence of characters, which can include alphanumeric-special character combinations. What does that mean? A word is a string, a sentence is a string. Anything within double quotes ( " " ) is a string in programming. Here are a few examples:
word = "word"
sentence = "This is a sentence"And voila, you have a string! The next one is Boolean.
Boolean: Now this may sound complicated, but its really simple. It's either True, or its False. There are no other options! Let's take an example, I am a boy; hence,
boy = True
girl = FalseRemember, Boolean has to have the first letter capital, otherwise, python will not accept it.
boy = True [Correct]
boy = true [Incorrect] Integers: They are basically your numbers, without decimal places. Any whole number is an integer! For example:
age = 15
year = 2020And finally,
Float: They are integers with decimals! These are extremely useful in calculating something slightly more complex. For example:
height = 2.4
width = 1.8Let's run the example below to see our work in action
Click here to move on to the next step!



![Step 4 - Loop Statements [If-Else Loop]](https://static.wixstatic.com/media/42d443_745a4191d3504a669bd6952afc87fb5d~mv2.jpg/v1/fill/w_251,h_321,al_c,q_80,enc_avif,quality_auto/42d443_745a4191d3504a669bd6952afc87fb5d~mv2.jpg)
Comments