小编Dev*_*wen的帖子

Python 输入函数在 VS Code 中不起作用

    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')
Run Code Online (Sandbox Code Playgroud)

当我使用代码运行程序扩展运行代码时,代码显示在终端中,但是当它到达输入函数时,它会冻结,就像要求我输入一些数据一样,但我无法输入数字或字母。

这是终端显示的...

[Running] python -u "c:\Users\bowen\Desktop\CSE 120\PROJECT 3\main.py"
Current Balance:  100
1. WITHDRAW
2. DEPOSIT
Select an option... 
Run Code Online (Sandbox Code Playgroud)

python terminal input visual-studio-code vscode-code-runner

8
推荐指数
3
解决办法
2万
查看次数