pycharm自动打印变量值

时间:2017-07-26 03:34:45

标签: python pycharm

我是python的新手,我遇到了pycharm的问题。 如下图所示,我输入def main(): globalConstantList = [QUIZ_GRADES, PROGRAM_GRADES, TESTS] scoreList = [0] * (QUIZ_GRADES + PROGRAM_GRADES + TESTS) returnedScoresList = getGrades(globalConstantList, scoreList) #totalList(totalScore[scores]) #userOutput() print(returnedScoresList) def getGrades(globalConstantList, scoreList): for eachScore in globalConstantList: #totalScoreList = 0.0 #index = 0 <-- not needed for index in range(QUIZ_GRADES): print("What is the score for quiz", index + 1) scoreList[index] = float(input()) imin = QUIZ_GRADES for index in range(imin, PROGRAM_GRADES + imin): print("What is the score for program", index + 1) scoreList[index] = float(input()) imin += PROGRAM_GRADES for index in range(imin, TESTS + imin): print("What is the score for test", index + 1) scoreList[index] = float(input()) return scoreList main() 而没有打印。但是运行结果仍然显示变量的值。这太令人困惑了。

enter image description here

1 个答案:

答案 0 :(得分:0)

在这个版本中,没有这个令人困惑的问题。

PyCharm 2017.1.5
Build #PY-171.4694.67, built on July 4, 2017

enter image description here