Basics of Python's object and data structures

in STEMGeeks4 months ago

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.
90E4EE7A-5B2F-4790-BFF7-37C7C9E6492A.jpegsource
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."
11AD7944-F588-4706-BE0C-54CD5DA26C40.jpegsource
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:
    /?|()[email protected]#$ %&*+- >
  • 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

Posted with STEMGeeks

Sort:  

Nice begining to learn variables!!
!1UP

You can earn passive income by delegation of tribe tokens to "The Cartel".

dlmmqb-TheCartel-banner
Click this banner to join "The Cartel" discord server to know more.

This will be so helpful for beginners in python programming.

Your content has been voted as a part of Encouragement program. Keep up the good work!

Use Ecency daily to boost your growth on platform!

Support Ecency
Vote for new Proposal
Delegate HP and earn more

1UP-PIZZA.png

You have received a 1UP from @gwajnberg!

The @oneup-cartel will soon upvote you with:
@stem-curator, @vyb-curator, @pob-curator, @neoxag-curator
And they will bring !PIZZA 🍕.

Learn more about our delegation service to earn daily rewards. Join the Cartel on Discord.

PIZZA!

PIZZA Holders sent $PIZZA tips in this post's comments:
@curation-cartel(10/20) tipped @shamzy (x1)

Join us in Discord!