Python 无法同时使用def和input

Python 无法同时使用def和input,python,python-3.x,function,input,Python,Python 3.x,Function,Input,我是一名编程新手,并试图通过edx/microsoft学习编程 我在这项任务上失败了,不知怎么的,我不明白 定义yell_this()并使用变量参数调用 define variable words_to_yell as a string gathered from user input() Call yell_this() with words_to_yell as argument get user input() for the string words_to_yell

我是一名编程新手,并试图通过edx/microsoft学习编程

我在这项任务上失败了,不知怎么的,我不明白

定义yell_this()并使用变量参数调用

define variable   words_to_yell   as a string gathered from user  input()
Call  yell_this()  with   words_to_yell  as argument
get user input() for the string words_to_yell

我正在linux上的AzureJupyter笔记本上使用python 3,我将尽我所能回答这个问题

第一步

将变量词_to_yell定义为从用户输入()收集的字符串

在python中,可以定义如下所示的变量:

words_to_yell = input('Please provide a word to yell: ')
words_to_yell()
这将定义一个包含用户传入内容的变量

第二步

调用yell_this(),使用单词\u to \u yell作为参数 假设定义了这个函数,可以这样调用它

#定义函数并请求用户输入

def words_to_yell():
    words_to_yell = input("Please type words to yell:")
    print(words_to_yell.upper() + "!!!")
#按如下方式调用函数:

words_to_yell = input('Please provide a word to yell: ')
words_to_yell()

如果你指向你正在学习的资源,这将非常有帮助。链接将是伟大的!非常感谢。我已经解决了我的问题,我以前没有定义要喊的词!