-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaths.py
31 lines (24 loc) · 854 Bytes
/
maths.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
#Input our numbers
first_value=int(input("Please enter a whole number:"))
second_value=int(input("Now a second: "))
#Remind the user what they put
print("You entered {} and {}.".format(first_value,second_value))
#Now do some maths!!
print("Adding: {} + {} = {}".format(first_value,second_value,first_value+second_value))
print("Subtracting: {} - {} = {}".format(first_value,second_value,first_value-second_value))
print("Multiplying: {} x {} = {}".format(first_value,second_value,first_value*second_value))
print("Diving: {} % {} = {}".format(first_value,second_value,first_value/second_value))
print("**********")
print("using %")
print(10%4)
print(10%3)
print("using //")
print(10//4)
print(10//3)
print("using +=")
a = 10
b = 9
print("a =" + str(a))
print("b = " + str(b))
a+=b
print("New value of a =" + str(a))