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