我们的几何老师给了我们一个作业,要求我们创建一个玩具在现实生活中何时使用几何的示例,因此我认为编写一个程序来计算填充一定数量的水池需要多少加仑水会很酷。形状,并具有一定的尺寸。注意,这是在python中。这是到目前为止的程序:import easyguieasygui.msgbox("This program will help determine how many gallons will be needed to fill up a pool based off of the dimensions given.")pool=easygui.buttonbox("What is the shape of the pool?", choices=['square/rectangle','circle'])if pool=='circle': hei=easygui.enterbox("How deep is the pool?") radi=easygui.enterbox("What is the distance between the edge of the pool and the center of the pool (radius)?") areaC=3.14*(float(radi)**2) * float(hei) easygui.msgbox=("You need " + str(areaC) + "gallons of water to fill this pool.")每次我到达第8行(areac = 3.14 ...)时,该程序似乎都停止了,并且没有显示错误,好像该程序已经完成了一样,但是应该将池的容量显示为在第9行中看到。它只是不会做...我在做什么错?
1 回答

陪伴而非守候
TA贡献1757条经验 获得超8个赞
我不了解python,所以我可能是100%错误,但是在第2行上您编写了“ easygui.msgbox(”,而在第0行上则编写了“ easygui.msgbox =(”。等号与它有关系吗? ?
添加回答
举报
0/150
提交
取消