2017-10-19 8 views
1

edxの初心者のためのMicrosoftのPythonコースの紹介に従っています。私は2番目のモジュールで問題が発生しています。入力された名前。関数内のユーザー入力を定義する際に問題が発生する

これは、彼らが提供するアドバイスです:

  • は(関数make_doctorの定義)
  • GETユーザーの入力変数FULL_NAMEため
  • コール機能引数
  • プリントとしてFULL_NAMEを使用してパラメータ名を取ります戻り値
  • ユーザー入力からfull_name引数を指定してmake_doctor()を作成して呼び出し、戻り値を出力します。

これは私がこれまで持っているものです。

def make_doctor(name): 
full_name = print("Doctor" + input().title()) 
return full_name 

print(name) 

は、任意のヘルプをお願い申し上げます。

あなたを助ける必要があります

答えて

1

def make_doctor(name): 
    return "Doctor" + name 


full_name = input() 
print(make_doctor(full_name)) 
0
def make_doctor(name): 
    # add the Doctor title to the name parameter 
    d_name = 'Doctor '+name 
    # print the return value 
    print(d_name) 
    return d_name 

# get the user input for the variable full_name 
full_name=input('Enter your full name: ') 
# pass full_name as an argument to make_doctor function 
doc = make_doctor(full_name) 
# print return value 
print(doc) 
関連する問題