我們的幾何老師給了我們一個作業,要求我們創建一個玩具在現實生活中何時使用幾何的示例,因此我認為編寫一個程序來計算填充一定數量的水池需要多少加侖水會很酷。形狀,并具有一定的尺寸。注意,這是在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
提交
取消