Assignment Operators in Python - Python Tutorial for Beginners

preview_player
Показать описание
🎓Welcome back to Digital Academy, the Complete Python Development Tutorial for Beginners, which will help you Learn Python from A to Z!

🖥️ Types of Operators in Python - Assignment Operators in Python.

Depending upon the type of operations you want to perform, there are 7 types of operators in Python: Arithmetic operators, Assignment operator, Comparison operators, Logical operators, Bitwise operators, Identity operators and Membership operators.

○ Assignment Operators in Python

Assignment operators are used to assign values to the variables, or any other object in Python. For instance, x = 5 is a simple assignment operator that assigns the value 5 (on the right) to the variable x (on the left).

There are also multiple compound operators in Python, like: x += 5, that adds to the variable and later assigns the same. Therefore, this is the equivalent of: x = x + 5

○ = : Assigns a value to a variable (simple assignment)
○ += : Adds a value and the variable and assigns the result to that variable (increment assignment)
○ -= : Subtracts a value from the variable and assigns the result to that variable (decrement assignment)
○ *= : Multiplies the variable by a value and assigns the result to that variable (multiplication assignment)
○ /= : Divides the variable by a value and assigns the result to that variable (division assignment)
○ **= : Raises the variable to a specified power and assigns the result to the variable (power assignment)
○ %= : Computes the modulus of the variable and a value and assigns the result to that variable (modulus assignment)
○ //= : Floor divides the variable by a value and assigns the result to that variable (floor division assignment)

Let's play this video, stick around and watch until the end of this video! 👍🏻

- Digital Academy™ 🎓

***

☞ WATCH NEXT:

#Python #Tutorial #Beginners #Shorts

***

♡ Thanks for watching and supporting ♡
Please Subscribe. Hit the notification bell.
Like, Comment and Share.

***

♡ FOLLOW US ♡

♡ SUPPORT US ♡

***
Рекомендации по теме
Комментарии
Автор

Did you know ALL Assignment Operators in Python? 🤔

DigitalAcademyOnline
welcome to shbcf.ru