加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ex4.py 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
cars = 100 #Give the variable "cars" value: 100
space_in_a_car = 4.0 #Give the variable "space_in_a_car" value: 4.0,It is a floating point variable
drivers = 30 #Give the variable "drivers" value: 30
passengers = 90 #Give the variable "passengers" value: 90
cars_not_driven = cars - drivers #Give the variable "cars_not_driven"=cars - drivers
cars_driven = drivers #Give the variable "cars_driven"=drivers
carpool_capacity = cars_driven * space_in_a_car #Give the variable "carpool_capacity"=cars_driven * space_in_a_car
average_passengers_per_car = passengers / cars_driven #Give the variable"average_passengers_per_car" = passengers / cars_driven
print"There are",cars,"cars available."
print"There are only",drivers,"drivers available."
print"There 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."
i=1
j=2.0
x=i/j
print x
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化