filmov
tv
Lec- 8: What is an Assignment Operators in Python? | Examples of Operators in Python | #ai #ml #ds
Показать описание
I've decided to upload each lecture with an example of an operator to make things easier for students. Short videos are easier to watch and understand, so practice a lot.
Please subscribe and comment because I want to improve education for all students, particularly economically challenged pupils.
Topics covered during this session:
1. Assignment Operator
2. Examples of Assignment Operator
Assign: This operator is used to assign the value from the right side of the expression to the left side operand using = operator.
Note:
Remember that, unlike other programming languages, Python does not have increment (++) or decrement (--) operators.
Explanation:
1. Assign (=)
Assigns values from right side operands to left side operands. It is used to assign values to variables and objects.
2. Add and Assign (+=)
It adds the right operand to the left operand and assigns the result to the left operand.
3. Subtract and Assign (-=)
It subtracts the right operand from the left operand and assigns the result to the left operand.
4. Multiply and Assign (*=)
It multiplies the right operand with the left operand and assigns the result to the left operand.
5. Divide and Assign (/=)
It divides the left operand with the right operand and assigns the result to the left operand.
6. Modulus and Assign (%=)
It takes modulus using two operands and assigns the result to the left operand.
7. Exponents and Assign (**=)
Performs exponential (power) calculation and assigns value to the left operand.
8. Floor divide and Assign (//=)
It performs floor division on the operand and assigns value to the left operand.
Please subscribe and comment because I want to improve education for all students, particularly economically challenged pupils.
Topics covered during this session:
1. Assignment Operator
2. Examples of Assignment Operator
Assign: This operator is used to assign the value from the right side of the expression to the left side operand using = operator.
Note:
Remember that, unlike other programming languages, Python does not have increment (++) or decrement (--) operators.
Explanation:
1. Assign (=)
Assigns values from right side operands to left side operands. It is used to assign values to variables and objects.
2. Add and Assign (+=)
It adds the right operand to the left operand and assigns the result to the left operand.
3. Subtract and Assign (-=)
It subtracts the right operand from the left operand and assigns the result to the left operand.
4. Multiply and Assign (*=)
It multiplies the right operand with the left operand and assigns the result to the left operand.
5. Divide and Assign (/=)
It divides the left operand with the right operand and assigns the result to the left operand.
6. Modulus and Assign (%=)
It takes modulus using two operands and assigns the result to the left operand.
7. Exponents and Assign (**=)
Performs exponential (power) calculation and assigns value to the left operand.
8. Floor divide and Assign (//=)
It performs floor division on the operand and assigns value to the left operand.
Комментарии