Assignment Operators in Python - #14
Share
Summary
An introduction to using assignment operators in Python, focusing on how to combine arithmetic operations with assignment to write more elegant code.
Highlights
Introduction to Assignment00:00:00
Explanation of the basic equal sign (=) as an assignment operator, which is used to store values within variables.
Using Combined Math Assignment Operators00:01:33
Introduction to shorthand assignment operators like +=, -=, *=, /=, **=, and %=, which perform a math operation and then reassign the result to the variable.
The Importance of Reassignment00:04:09
A demonstration showing that simply using a math operator on a variable in a print statement does not update the variable's value; one must use an assignment operator to save the updated value for future use in the program.
Review of Operators and Modulus00:05:43
A summary of how various math operators work with assignment, including a brief refresher on how the modulus operator returns the remainder of a division.
Recently Summarized Articles
Related summaries
- If Else Statements in Python | Python for Beginners
- Learn Pandas in 30 Minutes - Python Pandas Tutorial
- Digging my way out of prison with a SPOON
- Flowchart tutorial
- Python Tutorial for Beginners 6: Conditionals and Booleans - If, Else, and Elif Statements