-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMath Operators.py
More file actions
51 lines (40 loc) · 1.16 KB
/
Copy pathMath Operators.py
File metadata and controls
51 lines (40 loc) · 1.16 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#Arithmetic
print(5+5)
print(10-5)
print(1/5)
print(1//5)
print(2**5)
print(12%3)
print("")
#Comparison
print(4>4)
print(4>=4)
print(4==4)
print(4!=4)
print("")
#Logical
print(4<5 and 4>3)
print(4<5 or 4>3 )
print(not (False))
#Homework - Can you go on the ride or not? How many ice creams do you need? etc.
"""weight=int(input("Enter your weight:"))
age=int(input("Enter your age:"))
if weight>35 and age>12:
print("You can go on the ride because you weigh more than 35KG and you are older than 12")
else :
print("Sorry your age is less than 12 and your weight is less than 35kg therefore you may not go on the ride!")"""
"""p1=int(input("how many ice-creams do you want!!!!!!!!"))
if p1<2 and p1>0:
print("Here is a regular ice-cream.")
if p1<3 and p1>1:
print("here is a double ice cream.")
if p1<4 and p1>2:
print("Here is a family pack.")
if p1<5 and p1>3:
print("here is a family pack.")
if p1<6 and p1>4:
print("Here is a happiness pack.")
if p1<7 and p1>5:
print("here is a happiness pack.")
elif p1>6:
p2=(input("Wich ice cream pack would you like regular,double,family or the happiness pack?"))"""