[Python #5] create e29.py
This commit is contained in:
parent
13c38af736
commit
885832e4a2
2 changed files with 37 additions and 0 deletions
35
kjg/python-the-hard-way/e29.py
Normal file
35
kjg/python-the-hard-way/e29.py
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
people = 21
|
||||||
|
cats = 33
|
||||||
|
dogs = 14
|
||||||
|
|
||||||
|
|
||||||
|
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!")
|
||||||
|
|
||||||
|
if people != dogs:
|
||||||
|
print("People are not dogs.")
|
||||||
|
|
||||||
|
|
||||||
|
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.")
|
||||||
|
|
|
@ -115,3 +115,5 @@ practice debug code
|
||||||
How to use True and Flase
|
How to use True and Flase
|
||||||
**** ex28
|
**** ex28
|
||||||
How to use Boolean
|
How to use Boolean
|
||||||
|
**** ex29
|
||||||
|
How to use if-statement
|
||||||
|
|
Loading…
Reference in a new issue