From 5230394ef8ccf8f03f9a060be6bc5a45631e7202 Mon Sep 17 00:00:00 2001 From: kjg Date: Wed, 27 May 2020 22:03:11 +0900 Subject: [PATCH] [Python #5] update e30.py --- kjg/python-the-hard-way/e30.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/kjg/python-the-hard-way/e30.py b/kjg/python-the-hard-way/e30.py index ca2228f..a790c43 100644 --- a/kjg/python-the-hard-way/e30.py +++ b/kjg/python-the-hard-way/e30.py @@ -2,26 +2,27 @@ people = 21 cars = 15 trucks = 30 -if cars > people: - print("We should take the cars.") -elif cars < people: - print("We should not take the cars.") +if cars > people: #check cars are bigger than people + print("We should take the cars.") #print if cars are bigger than people +elif cars < people: #check cars are smaller than people + print("We should not take the cars.") #print if cars are smaller than people else: - print("We can't decide.") + print("We can't decide.") #print if cars are same with people -if trucks > cars: - print("That's too many trucks.") -elif trucks < cars: - print("Maybe we could take the trucks.") +if trucks > cars: #check trucks are bigger than cars + print("That's too many trucks.") #print if trucks are bigger than cars +elif trucks < cars: #check trucks are smaller than cars + print("Maybe we could take the trucks.") #print if trucks are smaller than cars else: - print("We still can't decide.") -if people > trucks: - print("Alright, let's just take the trucks.") + print("We still can't decide.") #print if trucks are same with cars + +if people > trucks: #check people are bigger than trucks + print("Alright, let's just take the trucks.") #print if people are bigger than trucks else: - print("Fine, let's stay home then.") + print("Fine, let's stay home then.") #print if people are bigger than trucks -if cars > people or trucks < cars: - print("cars are many") +if cars > people or trucks < cars: #check cars are bigger than people or trucks are smaller than cars + print("cars are many") #print if cars are bigger than people or trucks are smaller than cars else: - print("trucks or people is bigger") + print("trucks or people is bigger") #print not (cars > people or trucks < cars)