[root@mysql1 pshell]# cat ex4.py
#!/usr/bin/env Python
#-*-coding:utf-8-*-
cars = 100
space_in_a_car = 4
drivers = 30
passengers = 90
cars_not_driven = cars - drivers
cars_driven = drivers
carpool_capacity = cars_driven * space_in_a_car
average_passengers_per_car = passengers / cars_driven
print "there are", cars , "cars available."
print "there are only", drivers, "drivers available."
print "three will be", cars_not_driven, "empty cars today."
print "we can transport", carpool_capacity, "people today."
print "we have", passengers, "to carpool today."
print "we need to put about", average_passengers_per_car, "in each car."
[root@mysql1 pshell]# python ex4.py
there are 100 cars available.
there are only 30 drivers available.
three will be 70 empty cars today.
we can transport 120 people today.
we have 90 to carpool today.
we need to put about 3 in each car.
#!/usr/bin/env Python
#-*-coding:utf-8-*-
cars = 100
space_in_a_car = 4
drivers = 30
passengers = 90
cars_not_driven = cars - drivers
cars_driven = drivers
carpool_capacity = cars_driven * space_in_a_car
average_passengers_per_car = passengers / cars_driven
print "there are", cars , "cars available."
print "there are only", drivers, "drivers available."
print "three will be", cars_not_driven, "empty cars today."
print "we can transport", carpool_capacity, "people today."
print "we have", passengers, "to carpool today."
print "we need to put about", average_passengers_per_car, "in each car."
[root@mysql1 pshell]# python ex4.py
there are 100 cars available.
there are only 30 drivers available.
three will be 70 empty cars today.
we can transport 120 people today.
we have 90 to carpool today.
we need to put about 3 in each car.