From 885832e4a25089cabb07d176a90342bc19f20bd2 Mon Sep 17 00:00:00 2001 From: kjg Date: Wed, 27 May 2020 21:38:55 +0900 Subject: [PATCH] [Python #5] create e29.py --- kjg/python-the-hard-way/e29.py | 35 ++++++++++++++++++++++++++++++++++ kjg/python.org | 2 ++ 2 files changed, 37 insertions(+) create mode 100644 kjg/python-the-hard-way/e29.py diff --git a/kjg/python-the-hard-way/e29.py b/kjg/python-the-hard-way/e29.py new file mode 100644 index 0000000..a257dc6 --- /dev/null +++ b/kjg/python-the-hard-way/e29.py @@ -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.") + diff --git a/kjg/python.org b/kjg/python.org index 674907e..d3b4b36 100644 --- a/kjg/python.org +++ b/kjg/python.org @@ -115,3 +115,5 @@ practice debug code How to use True and Flase **** ex28 How to use Boolean +**** ex29 +How to use if-statement