为了账号安全,请及时绑定邮箱和手机立即绑定

为什么我的程序在不应该停止的时候停止,我该如何解决呢?

为什么我的程序在不应该停止的时候停止,我该如何解决呢?

白衣非少年 2021-03-22 17:02:59
我们的几何老师给了我们一个作业,要求我们创建一个玩具在现实生活中何时使用几何的示例,因此我认为编写一个程序来计算填充一定数量的水池需要多少加仑水会很酷。形状,并具有一定的尺寸。注意,这是在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 =(”。等号与它有关系吗? ?


查看完整回答
反对 回复 2021-03-30
  • 1 回答
  • 0 关注
  • 156 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号