Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAiden van der Berg
7,297 PointsI need a little help
Why is there a name error coming through when I thought it was right?
def hello_student(name):
return "Hello " + name
hello_student(name)
1 Answer
boi
14,242 PointsHello there Aiden,
There are two problems with your code, the 1st is the code you displayed here, the 2nd is you did not fulfill the challenge requirements.
Let's analyze the 1st problem;
def hello_student(name):
return "Hello " + name
The first two lines of your code have no problems, which is displayed above.
hello_student(name) #Here is the problem
The problem arises in the function call hello_student(name)
, you passed in name
as an argument, you told the program that name
is a variable or that name
has a stored value, does name
have a stored value? did you assign name
to something?
Now what could have made sense, is that you passed in "name"
instead of name
, did you notice the difference?
Coming to your 2ND problem regarding the challenge requirements, the challenge whats you to make a variable called hello
and assign to it the function call hello_student("Aiden")
.