Basic Arithmetic Operations In Python Every Beginner Should Know

In Python, every user is supposed to grab and ascertain the main basic operations. These are the main scratch beginning features that are mandatory for all beginning uses.

How to perform arithmetic operations using:

  • Addition
  • Subtraction
  • Multiplications
  • Division

Follow and input the below code in either a code editor or Visual Studio Code:

1     # Basic arithmetic operations

2     Num1 = 10

3     Num2 = 2

4    

5     Addition = num1 + num2

6     Subtraction = num1 – num2

7     Multiplication = num1 * num2

8     Division = num1 / num2

9    

10    Print(“Addition:”, addition)

11     Print(“Subtraction:”, subtraction)

12     Print(“Multiplication:”, multiplication)

13     Print(“Division:”, division)

The code as mentioned earlier, prints to the console the result or the output of the code instructed into the system.

In addition, it tells the system to run and print out the result of each series as shown above, for example, the product of the number 2 and number 10, which will automatically be 20.

NOTE:

You can use the Visual Studio Code or Code Editor on phones to perform this operation or task. Meanwhile, any other editor can be used such as sublime as well.

About Author


Discover more from SURFCLOUD TECHNOLOGY

Subscribe to get the latest posts sent to your email.

Leave a Reply

Your email address will not be published. Required fields are marked *

Discover more from SURFCLOUD TECHNOLOGY

Subscribe now to keep reading and get access to the full archive.

Continue reading