[root@mysql1 pshell]# cat ex30.py
#!/usr/bin/env Python
#-*-coding:utf-8-*-
people=30
cars=40
buses=15
if cars>people:
print "we should take the cars."
elif cars<people:
print "we should not take the cars."
else:
print "we can't decide."
if buses>cars:
print "that's too many buses."
elif buses<cars:
print "maybe we could take the buses."
else:
print "we still can't decide."
if people>buses:
print "alright,let's just take the buses."
else:
print "fine,let's stay home then."
[root@mysql1 pshell]#
[root@mysql1 pshell]#
[root@mysql1 pshell]#
[root@mysql1 pshell]# python ex30.py
we should take the cars.
maybe we could take the buses.
alright,let's just take the buses.
#!/usr/bin/env Python
#-*-coding:utf-8-*-
people=30
cars=40
buses=15
if cars>people:
print "we should take the cars."
elif cars<people:
print "we should not take the cars."
else:
print "we can't decide."
if buses>cars:
print "that's too many buses."
elif buses<cars:
print "maybe we could take the buses."
else:
print "we still can't decide."
if people>buses:
print "alright,let's just take the buses."
else:
print "fine,let's stay home then."
[root@mysql1 pshell]#
[root@mysql1 pshell]#
[root@mysql1 pshell]#
[root@mysql1 pshell]# python ex30.py
we should take the cars.
maybe we could take the buses.
alright,let's just take the buses.