-
Notifications
You must be signed in to change notification settings - Fork 175
/
Copy pathex29-studydrills.py
44 lines (29 loc) · 940 Bytes
/
ex29-studydrills.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
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python3
# ex29: What If
people = 20
cats = 30
dogs = 15
if people < cats:
print("Too many cats! The world is doomed!")
if people > cats:
print("Not many cats! The world is saved!")
if people < dogs:
print("The world is drooled on!")
if people > dogs:
print("The world is dry!")
dogs += 5
if people >= dogs:
print("People are greater than or equal to dogs.")
if people <= dogs:
print("People are less than or equal to dogs.")
if people == dogs:
print("People are dogs.")
dogs += 5
if (dogs < cats) and (people < cats):
print("Cats are more than people and dogs. People are scared by cats!")
if (dogs < cats) and not (people < cats):
print("Cats are more than dogs. Mice are living a hard life!")
if (dogs == cats) or (cats < 10):
print("Cats are fighting against dogs! Mice are happy!")
if cat != 0:
print("Cats are still exist. Mice cannot be too crazy.")