2024-04-30 03:58:24 发布
网友
input_var = input ("Press 'E' and 'Enter' to Exit: ") NameError: name 'e' is not defined
我正在使用Python2.5。我怎样才能克服这个错误?
input读取并计算Python表达式。当它试图对其求值时,它会寻找一个未定义的变量e,并失败。
input
e
你几乎总是想用raw_input代替。(和in Python3, ^{} has this behaviour。)
raw_input
或者,更好的是,在Unix上,使用readline以便用户可以编辑他们的输入。
input
读取并计算Python表达式。当它试图对其求值时,它会寻找一个未定义的变量e
,并失败。你几乎总是想用} has this behaviour 。)
raw_input
代替。(和in Python3, ^{或者,更好的是,在Unix上,使用readline以便用户可以编辑他们的输入。
相关问题 更多 >
编程相关推荐