簡單的修復,但我怎樣才能使這個停止循環?輸出結果只是反覆詢問數值。還有一種方法可以檢查所有的值以確保在20到40之間?定義的函數重複循環
def main():
print("Welcome to the autostacker")
print(getDim())
def getDim():
height = int(input("Enter the height: "))
width = int(input("Enter the width: "))
length = int(input("Enter the width: "))
return getDim()
main()
更改'返回getDim()'爲'返回高度,重量,長度' – ssm 2014-10-27 05:38:29
您想如何顯示正在輸入的字段?你目前擁有的是一個永無止境的遞歸循環。 – 2014-10-27 05:40:44
[20
2014-10-27 05:41:45