Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Ground Controller Lvl 1
Message 1 of 3

Python function creation help!

I’m teaching myself Python and I’m still in the early stages of it and doing small little tasks provided by the lessons I’m finding. One of them has me stumped as can be and my brain is about to explode so I’m trying to avoid that. If possible, would you be able to help me? Once I have it, I will see it and be able to fully understand it, but I just can’t seem to put it all together right now. Here is what it is and what I have so far:

********************************************
# Doctor: A function at the “Doctor” title to a name
# Define a function ‘make_doctor()’ that takes a parameter ‘name’ (which I know how to do)
# Get user input for variable ‘full_name’ (which I know how to do)
# Call me function using ‘full_name’ as argument (this is stumping me)
# Print the return value

def make_doctor(name):
full_name = input(“Full name: “
name = (“Doctor”, full_name)
return name

make_doctor(full_name)
********************************************

It’s not correct, but I don’t know how to make it correct while following the directions of the comments. I can somewhat make it work with the code below, but it still outputs “Full name: “ in front of what it is supposed to and it also doesn’t follow the directions of the comments. HELP PLEASE! As said, once I can see it then it’ll click and I’ll understand.

def make_doctor(full_name = input(“Full name: “)):
print(“Doctor”, full_name)

make_doctor()
2 Replies
Copilot Lvl 2
Message 2 of 3

Re: Python function creation help!

add print () on the last line, you 

print(make_doctor(full_name))

that should be able to pront the name(s) entered

Copilot Lvl 2
Message 3 of 3

Re: Python function creation help!

try this and see if it works, the make_doctor(): don't require inputs as inputs are corrected within function, and if you wonna print, you should aslo have a print function

def make_doctor():
full_name = input('Full name: ')
name = print('Doctor:', full_name)
return name


make_doctor()