Variables.Data types.Simple operators

Nazrin
3 min readJan 4, 2021

For people interested in programming, it is necessary to know data types, variables, simple operators. Variables are symbols that contain different information that assist us to not repeat copy-paste actions, ensures efficient use of our time. These are some rules about variables: 1) Cannot start with numbers 2) Variable name cannot be used using spaces 3) Codes cannot be used as names 4) Symbol, variable name cannot be used using sign.

However, even if we do not completely deviate from these rules, it is possible to make a number of changes: For the first rule, you can write the number after the word or prefix “_” (underscore) and then use the number after. In the second rule, you can also find a solution to this rule by using underscores. The third rule is that if you use “print” as the name of the variable, it will give an error. Codes cannot be used as variable names. But you can create a variable by typing “Print” instead of “print”. Python is case sensitive, so it can distinguish them very easily. Nevertheless, there is no way for the 4th rule. Only underscores can be used as a variable between sign-symbols.

A data type provides a set of values from which an expression (i.e. variable, function, etc.) can take its values. Here is the most important data types: Booleans, numbers, bytes, dictionaries, lists, tuples, sets, strings. The types are divided to categories as:

Text Type: str

Boolean Type: bool

Numeric Types: int, float, complex

Mapping Type: dict

Sequence Types: list, tuple, range

Binary Types: bytes, bytearray, memoryview

Set Types: set, frozenset

We can clarify some of these data types. For instance, boolean data type is a type of data that will reduce your chances of encountering as you go to the machine language. It is a data type with a value of True or False. In general, we do not define bool value, we define structures that convert bool value.

Any letter, number, symbol can be part of string. Implemented inputs and outputs to the computer are in the form of character strings; that is, it is a string that went in and out. Therefore, it is the most commonly used data type in programming languages. In Python, the string (text) data type is a class called structures with comparison operators.

Operators are used to accomplish logical and arithmetic operations on values and variables. Here are the types of operators: arithmetic, comparison, assignment , logical, membership, identity and bitwise operators. As we know from the math, arithmetic operators are used to assign the values( =, +=, -=, *=, ^= etc), comparison operators are used to compare values (==, !=, >, <, >=, <=) , logical operators to combine statements ( and, not, or), identity operators to compare objects ( x is y , x is not y), membership operators defines and checks whether the sequence is presented in the object ( a in b, a not in b ), and finally bitwise operators compares given numbers that are binary using & ( and ), >> ( signed right shift), << ( zero fill left shift ), ~ ( NOT ), ^ ( XOR) , |( OR) .

--

--