标签:条件 car decide truck 情况下 int 作用 下一步 --
一 代码及执行结果
ex30.py
1 people = 14 2 cars = 15 3 trucks = 10 4 5 if cars > people: 6 print("We should take the cars.") 7 elif cars < people: 8 print("We should not take the cars.") 9 else: 10 print("We can‘t decide.") 11 12 if trucks > cars: 13 print("That too many trucks.") 14 elif trucks < cars: 15 print("Maybe we could take the trucks.") 16 else : 17 print("We stil can‘t decide.") 18 19 if people > trucks: 20 print("Alright,let‘s just take the trucks.") 21 else: 22 print("Fine, let‘s stay home then.")
执行结果:
PS E:\3_work\4_python\2_code_python\02_LearnPythonTheHardWay> python ex30.py We should take the cars. Maybe we could take the trucks. Alright,let‘s just take the trucks.
一些问题:
标签:条件 car decide truck 情况下 int 作用 下一步 --
原文地址:https://www.cnblogs.com/luoxun/p/13292567.html