私は非常にPythonとPythonの一般的な新機能です。数日前にダウンロードし、Kindleで購入したチュートリアルブックで1時間ほど練習しました。Python 3.6で定義されていない名前につづいています
問題が発生したので、私はこの練習をユーザーから受け取り、作成したストーリーに入力します。怒っているタイプのもののように。ここにコードがあります、それは私が得るエラーです。
print('It was a (adjective) October day. The infamous (noun) was (verb) South to escape the Winter.')
def get_adjective():
"""getting the adjective"""
adj=input('Please provide an adjective:')
return adj
def get_noun():
"""getting the noun"""
noun=input('Please provide a noun:')
return noun
def get_verb():
"""getting the verb"""
verb=input('Please provide a verb:')
return verb
get_adjective()
get_noun()
get_verb()
def putting_together(adj,noun,verb):
"""executing story"""
print('It was a {} October day. The infamous {} was {} South to escape the Winter.'.format(adj,noun,verb))
putting_together(adj,noun,verb)
あなたのいくつかは、すでに間違っているものを知っている、いずれかの方法ここで私は
It was a (adjective) October day. The infamous (noun) was (verb) South to escape the Winter.
Please provide an adjective:cold
Please provide a noun:John
Please provide a verb:riding
Traceback (most recent call last):
File "C:/Python36-32/practice.py", line 24, in <module>
putting_together(adj,noun,verb)
NameError: name 'adj' is not defined
それを実行したとき、私はそれがある見返りに取得するメッセージであることがあります。どんな助けもありがとうございます。私は言いますが、私は新しく、言語に完全に精通していません。物事をダンシングすることは役に立ちます。ありがとう。
私はあなたの最初の提案を試みました。それは私にすべての質問(提供してください...)を2回尋ねました。奇妙な。 – RantheMan
私はそれを手に入れました!ありがとうございました!次の練習へ – RantheMan