为什么我的代码不会在Visual Studio代码中运行?

问题描述 投票:0回答:0

屏幕截图是 我试图修复它,但仍然无法使用。我有以下代码: def deposit(): while True: amount = input("What would you like to deposit? $") if amount.isdigit(): amount = int(amount) if amount > 0: break else: print("Amount must be greater than 0.") else: print("Please enter a number.") return amount deposit()

结果是:

[运行] Python -u“ C:\ Users Dmin \ Desktop \ Python Project \ Main.py”

[完成]在0.095秒内以代码= 0退出

我忘了保存它,并试图运行它。我习惯了Google Colab的自动保存,我忘了保存文件然后运行。

python function-call
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.