【发布时间】:2019-03-05 04:01:50
【问题描述】:
这很奇怪,因为我的代码在在线 python 解释器中运行良好,但是当我使用 Atom 在 linux mint 中运行它时,当我输入一个单词时出现以下错误消息:
File "<string>", line 1, in <module>
NameError: name 'lol' is not defined
这是我的代码
# -*- coding: utf-8 -*-
word = str(input(" Enter a word : "))
reverse = word[::-1]
if reverse == word:
print("it is a palindrome, félicitation : ")
else:
print(" it is not a palindrome : ")
【问题讨论】:
标签: python python-3.x atom-editor