【发布时间】:2021-11-10 03:23:14
【问题描述】:
balance = 100
print('Current Balance: ', balance)
while balance > 0:
print('1. WITHDRAW')
print('2. DEPOSIT')
choice = input("Select an option... ")
if (choice == 1):
print('1')
elif (choice == 2):
print('2')
else:
print('test')
当我使用代码运行器扩展程序运行代码时,代码会显示在终端中,但是当它到达输入函数时,它会冻结,就像它要求我输入一些数据一样,但是我不能输入数字或字母。
这是终端显示的内容...
[Running] python -u "c:\Users\bowen\Desktop\CSE 120\PROJECT 3\main.py"
Current Balance: 100
1. WITHDRAW
2. DEPOSIT
Select an option...
【问题讨论】:
-
“但是当它到达输入功能时它会冻结,就像它要求我输入一些数据但是我不能输入数字或字母。”请具体。您是否尝试单击终端窗口并按下
1键或2键?当你这样做时,你看到相应的符号了吗?通常,您是否在该窗口中看到闪烁的光标?能直接从终端让代码正常运行吗?
标签: python visual-studio-code input terminal vscode-code-runner