-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsimplemath.py
36 lines (26 loc) · 985 Bytes
/
simplemath.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/python
#Every programmin language provides some kind of way of doing numbers and math.
#Simple Mathematics
#Python follows the PEDMAS rule during mathematical calculations PEMDAS, which stands for parentheses, exponent, multiplication, division, addition and subtraction.
#It details the order of operations,and also note,
#In Python we have three types of division, regular division('\'), floor division("\\") and finding the remainder('%'),
#Using what's called modulo.
# + Addition
# - Subtraction
# / Division
# * Multiplication
# % Modulus
# < Less Than
# > Greater Than
# <= Less Than Equal
# >= Greater Than Equal
print( " Lets do some mathematics")
print("Bananas", 100 + 2 / 6)
print( "Mangoes", 50000 - 44444 * 29 % 6)
print( " Lets Count Watermelon now")
print( 3 + 2 + 1 - 5 + 4 % 2 - 1)
print( " True or False")
print( 3 + 2 < 5 - 7)
print( "Is it greater?", 5 > -2)
print( "Is it greater or equal", 5 >= -2)
print( "Is it less or equal", 5 <= -2)