我正在尝试使用def()函数创建一个联系人列表,以便稍后在代码中轻松循环回到顶部。我遇到的问题是,我在def部分定义了"function_question“,但当我运行代码时,它会给我一个NameError,告诉我"function_question”没有定义。#Created a def so I can easily run back the code to the top.def user_prompt():
print('Welcome to y
我试图为一个开始的python类完成一个赋值,该类要求我们编写一个def函数,该函数接受一个字符串作为参数,并返回该单词复数的最佳猜测。它没有返回任何语法错误,所以我是不是遗漏了会触发def函数的东西?请帮我理解我错过了什么。singular_word = input("Please enter a word to be pluralized ")
def pluralize_word(singular_word):