1 Star 0 Fork 0

yingke_ago/pythonhardway

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ex4.py 710 Bytes
一键复制 编辑 原始数据 按行查看 历史
yingke_ago 提交于 2023-03-14 23:04 . ex1-ex4
# 第四天
# 变量和命名
# 在编程中,变量只不过是用来指代某个东西的名字
# 汽车
cars = 100
# 车内空间
space_in_a_car = 4.0
# 驾驶员
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("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.")
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/yingke/pythonhardway.git
git@gitee.com:yingke/pythonhardway.git
yingke
pythonhardway
pythonhardway
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385