1
我是一个python新手,现在学习基础知识。我尝试了下面的def函数,但它表明一个错误。有人能告诉我我在语法中犯了什么错误吗?def function python - 帮我使用语法
(我用正确的缩进写的。但Stakoverflow窗口并不表示我粘贴)
# This will test the reverse function of the program
def rev(text) :
text = input()
return text [::-1]
print("Please Enter a word")
input()
rev(text)
input() # This is to avoid the screen closing immediately after executing the
# program
它也没有必要打印提示,然后分别调用input()。输入(“请输入一个单词”)将完成两个。 – seaotternerd
@seaotternerd谢谢:)补充说,在答案:) – thefourtheye