Image

Anyone Can Code.





Image


Arithmetic Operators



Avi Bhattacharya



Operator Operation
+ Addition
- Subtraction
* Multiplication
/ Division
% Remainder
// Floor Division: rounds down to nearest integer
** Exponent

Let's take a look at all of these in action.


    x= 2
    y= 5
    print (x+y)
    print (x-y)
    print (x*y)
    print (x/y)
    print (x%y)
    print (y//x)
    print (x**y)
                                          
7 -3 10 0.4 2 2 32

Here's a graphic for a quick recap:


That's it for this tutorial! Click Next to access the next tutorial!

❮ Back

Next ❯









Copyright © 2020, Q-Programming | Created by Arjun Sodhi, Balpreet Juneja and Sammarth Kumar | Developed and Designed by Sammarth Kumar