[Python #5] update e30.py

This commit is contained in:
kjg 2020-05-27 22:03:11 +09:00
parent 34322bf08d
commit 5230394ef8

View file

@ -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)