[Python #5] update e30.py
This commit is contained in:
parent
34322bf08d
commit
5230394ef8
1 changed files with 17 additions and 16 deletions
|
@ -2,26 +2,27 @@ people = 21
|
||||||
cars = 15
|
cars = 15
|
||||||
trucks = 30
|
trucks = 30
|
||||||
|
|
||||||
if cars > people:
|
if cars > people: #check cars are bigger than people
|
||||||
print("We should take the cars.")
|
print("We should take the cars.") #print if cars are bigger than people
|
||||||
elif cars < people:
|
elif cars < people: #check cars are smaller than people
|
||||||
print("We should not take the cars.")
|
print("We should not take the cars.") #print if cars are smaller than people
|
||||||
else:
|
else:
|
||||||
print("We can't decide.")
|
print("We can't decide.") #print if cars are same with people
|
||||||
|
|
||||||
|
|
||||||
if trucks > cars:
|
if trucks > cars: #check trucks are bigger than cars
|
||||||
print("That's too many trucks.")
|
print("That's too many trucks.") #print if trucks are bigger than cars
|
||||||
elif trucks < cars:
|
elif trucks < cars: #check trucks are smaller than cars
|
||||||
print("Maybe we could take the trucks.")
|
print("Maybe we could take the trucks.") #print if trucks are smaller than cars
|
||||||
else:
|
else:
|
||||||
print("We still can't decide.")
|
print("We still can't decide.") #print if trucks are same with cars
|
||||||
if people > trucks:
|
|
||||||
print("Alright, let's just take the trucks.")
|
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:
|
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:
|
if cars > people or trucks < cars: #check cars are bigger than people or trucks are smaller than cars
|
||||||
print("cars are many")
|
print("cars are many") #print if cars are bigger than people or trucks are smaller than cars
|
||||||
else:
|
else:
|
||||||
print("trucks or people is bigger")
|
print("trucks or people is bigger") #print not (cars > people or trucks < cars)
|
||||||
|
|
Loading…
Reference in a new issue