Day 3: python data type.

Today i went through something every programmer must understand deeply “data types”. Not just in theory, but to use them practically with arrays (lists) and simple logic.

so what are data types in python

In Python, I learnt that everythi…


This content originally appeared on DEV Community and was authored by Rebecca-254

Today i went through something every programmer must understand deeply "data types". Not just in theory, but to use them practically with arrays (lists) and simple logic.

so what are data types in python

In Python, I learnt that everything is an object and every object has a type.
Data types are just the “kind” of information your code is working with.

Whether it’s a name, a number, a yes/no response, or even a list of items Python wants to know: “What type of data is this?”

common data types in python

  1. Integer 'int'

This are digits. They are whole numbers either negative or positive. For example

Points=[7][5][8][6][9]  #list of integers.
  1. Float 'float'

This are used to show numbers with decimal points. For example

Temperature= 36.7

3.string 'str'

This is used in any text inside a quote. Can be a number, name or even emojis. For example

Name= "Rebecca"

4.Boolean 'bool'

This used in logic values. Either true or false. Suitable for conditions. For example

is-coding-cool=true 
  1. List 'list'

This is just a collection of multiple items in a single variable. One can mix items too. For example

my_list = [10, "apple", True, 3.5]
print(type(my_list))  # <class 'list'>
  1. Tuples 'tuple' This one is the same as list but in this case can not be changed. For example
my_birthdate = (2004, 6, 23)
  1. Dictionary 'doct' Is just collection of key-value pairs — like mini-databases. For example
student = {"name": "Rebecca", "age": 21}
  1. Set 'set'

Is an unordered collection of unique values where duplicates are ignored. For example

unique_numbers = {1, 2, 2, 3}

It gives 1,2,3 as the results

summary

a summary block diagram on data tupes

What I tried

I opened my VS Code and wrote simple examples for each type.
Then printed the type using type() and played with changing values. Like

  1. Adding integers and floats
  2. Joining strings
  3. Creating a list of my favorite colors 4.Creating a dictionary for a student profile

It felt great seeing Python understand what I meant just by using the right type.

Thanks for reading
If you’ve just started learning Python, feel free to reach out or comment below. Let’s grow together

GitHub: Rebecca-254


This content originally appeared on DEV Community and was authored by Rebecca-254


Print Share Comment Cite Upload Translate Updates
APA

Rebecca-254 | Sciencx (2025-06-26T21:30:15+00:00) Day 3: python data type.. Retrieved from https://www.scien.cx/2025/06/26/day-3-python-data-type/

MLA
" » Day 3: python data type.." Rebecca-254 | Sciencx - Thursday June 26, 2025, https://www.scien.cx/2025/06/26/day-3-python-data-type/
HARVARD
Rebecca-254 | Sciencx Thursday June 26, 2025 » Day 3: python data type.., viewed ,<https://www.scien.cx/2025/06/26/day-3-python-data-type/>
VANCOUVER
Rebecca-254 | Sciencx - » Day 3: python data type.. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/06/26/day-3-python-data-type/
CHICAGO
" » Day 3: python data type.." Rebecca-254 | Sciencx - Accessed . https://www.scien.cx/2025/06/26/day-3-python-data-type/
IEEE
" » Day 3: python data type.." Rebecca-254 | Sciencx [Online]. Available: https://www.scien.cx/2025/06/26/day-3-python-data-type/. [Accessed: ]
rf:citation
» Day 3: python data type. | Rebecca-254 | Sciencx | https://www.scien.cx/2025/06/26/day-3-python-data-type/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.