首页 > 解决方案 > 如何修复这行代码,以免出现任何语法错误?

问题描述

我很新,所以请放轻松。

我不断收到本节的语法错误代码(特别是“print()”并且不知道我做错了什么?有人可以看看并告诉我吗?

def name():  
    NAME=str(input("Why don't you introduce yourself to them, now that you've caught their eyes?")
    print(,NAME, "? Is that right? -yes/no-")
    answer = input(">").lower()

标签: pythonsyntax

解决方案


你错过了 str 函数的 ')' 和下一行你在 print 函数中有额外的 ','


推荐阅读