qq_36897542
new1991
2017-08-01 05:37

pycharm控制台乱码问题,ecoding上不可以设置

  • python

求大牛解答
pycharm代码如下

-*- coding: utf-8 -*-

print('--------------黄总跟李总比帅-------------')
bingo = '黄总比李总帅'
answer = input('你说黄总帅,还是李总帅?\n')
while True:
if answer == bingo:
break
answer = input('你这什么眼神,再给你次机会猜猜!\n')

print('你真有眼光,黄总老帅了!')
print('你是不是喜欢黄总啊!')

在python idle上可以执行,在pycharm只能输入数字,输入字符就报错

Traceback (most recent call last):
File "C:/Users/zcy/PycharmProjects/untitled/����.py", line 4, in
answer = input('你说黄总帅,还是李总帅?\n')
File "", line 1, in
NameError: name 'f' is not defined

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答