DEV Community

Si for CodeTips

Posted on • Originally published at codetips.co.uk on

3

What are data-types?

A bit of information (data) always has a certain type

What are data-types?

Each programming language has different data-types or names them differently, but most of them have a variation of these four:

Booleans

Booleans are simple binary values (true or false).

isTrue = true
isFalse = false
Enter fullscreen mode Exit fullscreen mode

In our previous article about if statements we showed you how programs determine between executing a block of code or not. The condition that is used for this can ultimately only have two outcomes: do it (true) or don't do it (false).

Integers

Integers are whole numbers (with no decimal places).

number = 5
Enter fullscreen mode Exit fullscreen mode

Floats

Floats are numbers that can have decimals, but do not always have to.

number = 3.5
Enter fullscreen mode Exit fullscreen mode

Strings

Strings are simply a series of characters (like words, names or whole sentences)

id = ckjasdiwe98213
name = John
lastname = Doe
job = John is working at a farm, growing potatoes
Enter fullscreen mode Exit fullscreen mode

AWS Q Developer image

Your AI Code Assistant

Ask anything about your entire project, code and get answers and even architecture diagrams. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Start free in your IDE

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay