What are data types?

When we are coding, we are using data in different ways. We might be using some text like "Well done! Level Up" or we might be using numbers like 1 or 100. It is important then that we understand that this variety of data is actually classified into 'data types'.

Data types are extremely important for all computer programming languages, and for us as programmers, because it impacts how well organised and efficient our program can be. So, let’s learn about some common data types: String, Integer (shortened to int), Floating point (shortened to float) and Boolean.

String: A set of characters that can contain text and numbers, as well as spaces and symbols. e.g. "We love to code!" or "I am 14 years old."

Int: Whole numbers e.g. 8, 29, 365

Float: Decimal numbers e.g. 8.3, 29.45, 365.12

Boolean: True or False

Did you know?

Boolean is named after the mathematician George Boole who developed an algebra of logic which is now called Boolean algebra. Boolean algebra is based on two statements- true and false.

Try this out at home with a partner:

What you will need:

1) Divide an A4 page into 4 categories using a pen and ruler.

2) Give each category a name using the following once: string, int, float, Boolean.

3) Based on our learning in the article above, classify all of the following data types into the categories you have on your page:

 3.14 False "Arcade" 25 "Hello World" 52.5555 76 "True" 17.2 "Game Over", true 2.5 20