Basics of Python's object and data structures
Hello đź‘‹đź‘‹đź‘‹ i hope you are doing well. It was a wonderful day for me because I got to meet my nephew for the first time. I have seen a lot of his pictures, but seeing him in person was a special feeling to me.
“Running Python Code” source and “A Python Programming Language Introduction and Installation Guide”source were topics I covered in may earlier blogs. As a result, I made the decision to pick up where I left off. The link is provided above in case you are interested in taking a look.
The fundamental building blocks of larger pieces of code are data types. I will go through some fundamental Python data types down below.
INTEGERS (int)
Whole numbers are considered integers. Examples include 5, 10, 8, and so on. Python programming classifies any whole number you can imagine as an integer.
FLOATING POINT (float)
In Python programming, a floating point is any number with a decimal point, such as 8.2, 1.5, or 3.0.
3.0, which is also known as 3 becomes a floating point whenever the point is signified.
STRINGS (str)
Strings are lists of objects that are double- or single-quoted, such as "man," "book," "Shamzy," "son," "1," etc. The single or double quotes are what distinguish an integer from a string.
LISTS ( list)
A list is an ordered grouping of items that uses commas and square brackets to group related items together. An example of this is [1, "book", 1.1], where we can see that the values in the square brackets correspond to an integer, a string, and a floating point, respectively.
DICTIONARIES (dict)
Contrary to lists, dictionaries are unordered key-value pairs that use braces and are not well organized. "Goat": "name," "book": "store,"
TUPLES (tup)
The term "tuple" refers to an ordered, immutable list of Python objects.
Due to their immutability, tuples cannot be changed after they have been generated. Parentheses are used to define tuples ().
SETS (set)
Sets simple refer to an unordered group of distinct items that are separated by commas and enclosed in braces ().
BOOLEANS (bool)
The logical value of a boolean is a True or False indication. True is denoted with a capital "T," while false is denoted by a capital "F."
CONDITIONS FOR SELECTING A VARIABLE NAME
Follow these guidelines to avoid mistakes when programming in Python:
- Names cannot begin with a number, for example. 1Alex. Instead of using a space in a name, use an underscore. For instance:
last letter (incorrect ❌❌❌)
last_letter (correctâś…âś…âś… ) - Avoid using any of the following symbols:
/?|()!@#$ %&*+- > - As much as possible , always use small letters in writing names
- Avoid using terms like "int," "float," "str," "list," "dict," "tup," "set," "bool," etc. that have unique meanings in Python.
Thank you for reading, I will greatly appreciate your support and any comments, additions, and corrections.
DISCORD: samzy#5007
Leave Basics of Python's object and data structures to:
Read more #stem posts
Best Posts From Shamzy
We have not curated any of shamzy's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Shamzy
- MY NYSC JOURNEY AND MY CURRENT SITUATION
- WAYS IN WHICH ARSENAL CAN MANAGE GABRIEL JESUS'S INJURY
- THE MOST UNFORGETTABLE MOMENTS FROM THE 2022 FIFA WORLD CUP (PART 2)
- THE MOST UNFORGETTABLE MOMENTS FROM THE 2022 FIFA WORLD CUP [PART 1]
- THE NINE MOST RECENT CHELSEA PLAYERS TO WEAR THE NUMBER 9 JERSEY
- TOP 10 PREMIER LEAGUE SIGNINGS (2022/2023) SO FAR (CONTD)
- TOP 10 PREMIER LEAGUE SIGNINGS (2022/2023) SO FAR
- Basics of Python's object and data structures
- FINALLY REGISTERED FOR MY PVC
- RUNNING PYTHON CODE 1
- FIVE THINGS OLEKSANDR ZINCHENKO WILL BRING TO ARSENAL
- MY WORLD’S BEST FOOTBALL SQUAD
- MY BEST ARSENAL SQUAD
- A FRIEND AND MORE!
- FOOTBALL TRANSFER RUMORS ON TUESDAY: STERLING, DE JONG AND MORE
- A MEMORABLE FOOTBALL MATCH AND STUDENT’S WEEK
- A PYTHON PROGRAMMING LANGUAGE INTRODUCTION AND INSTALLATION GUIDE
- A SUCCESSFUL FINAL YEAR PROJECT //Design and construction of an IOT based smart energy meter
- A SUCCESSFUL PROJECT DEFENSE
- YABA ART MUSEUM VISIT