亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么我的程序在不應該停止的時候停止,我該如何解決呢?

為什么我的程序在不應該停止的時候停止,我該如何解決呢?

白衣非少年 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 關注
  • 175 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號