我正在尝试编写一个符合这些规则的程序:
你的租约到期了,该搬家了。不幸的是,你有很多东西,你不想花太多时间移动它,因为你宁愿练习你的编程技能。谢天谢地,你有可以帮忙的朋友,尽管这种帮助是有代价的。你的朋友一小时可以搬动20个盒子,但他们需要一个16英寸(直径)的比萨饼。用Python编写一个函数,获取你拥有的盒子数量,并返回你需要购买多少平方英尺的比萨饼。使用函数头:sqFtPizza(numBoxes)
让它把比萨饼的平方英尺作为浮子送回来。你知道吗
这是我的密码
def sqFtPizza(numBoxes):
a = 3.14159*(8*8)
c = 1/12**2
sqft = a * c
za =numBoxes/20
area = za * sqft
print (area)
def question():
numBoxes= float(int(input("How many boxes do you have?: " )))
sqFtPizza(numBoxes)
question()
请帮忙?你知道吗
使函数名PEP8兼容
就像
相关问题 更多 >
编程相关推荐