How to Code PYTHON: Perform Mathematical Operations on Numbers

How to Code PYTHON: Perform Mathematical Operations on Numbers

Let's get started! πŸ”₯πŸ”₯πŸ”₯ In this video, we will show you how to write a few PYTHON 🐍 scripts to use several mathematical Python operators that allow you to perform typical mathematical operations βž•βž– on numeric data when building real-world Python programs. In this lesson, you will learn some basics in about 10 minutes!

🚨 Keep in mind that there are more complex operations available from the Python math module. In addition, there are mathematical operations and data science and visualization functionality from third-party open source libraries, such as Pandas, NumPy, SciPy, Matplotlib, and many others. πŸ“ŠπŸ“ˆ They are extremely useful in data science, data visualization, and machine learning.

In this video, you will learn how to:
β˜… 0:09 Perform various mathematical operations.
β˜… 3:07 Control the default order of operations, following PEMDAS.
β˜… 5:26 Investigate division more closely.
β˜… 6:21 Convert a float into an int.
β˜… 9:38 Round to a specific decimal place.

Tips and Tricks:
β–Ί Operators are mini shortcut functions that perform an operation on one or more operands.
β–ΊThe order of mathematical operations in Python follows the rules of PEMDAS.
Parentheses: Resolve operations between parentheses first.
Exponents: Resolve exponents.
Multiplication: Perform multiplication, from left to right.
Division: Perform division, from left to right.
Addition: Perform addition, from left to right.
Subtraction: Perform subtraction, from left to right.
β–Ί In Python 3, division of two ints produces a float.
β–Ί Values after the decimal are truncated and lost when a value of type float is converted to a value of type int.
β–ΊUse the round() function to control how values are rounded. It defaults to 0 places after the decimal, which gives you an int value. If the *optional* second argument is supplied, you can control the number of decimal places to round to.

🐍 Python Coding for Beginners:

For the setup, please read the followings before you begin:
1. Download latest Python:
2. Install Python and remember to select "Add Python... to PATH" when asked.
3. Download and install latest Visual Studio Code:
4. Install the Python extension for Visual Studio Code: Go to View and select Extensions, or select the Extensions icon, then search for python.

Python - a programming language used by world-class companies such as, Alphabet (Google), Facebook, Twitter, and NASA.


#CodingWithKids #PythonProgramming #PythonForBeginners