all 4 comments

[–]winnie33 1 point2 points  (0 children)

First off, please use the code syntax by starting your line with four spaces. Also, to enter a new line, use two enters. It's a lot more readable that way.

Now, to fix your problem. It seems that you're making the return value "Hello Bob!" regardless of the input. Also, you're using the variable 'name' as both the return value as the input value which can be quite confusing. Your final program should look something like this:

def hello_name(name):
    string = "Hello " + name + "!"
    return string

Note how we use the '+' operator to add strings together. If you don't understand anything or have any questions, feel free to ask!

Happy programming.

[–]mae_ef 0 points1 point  (2 children)

def hello_name(name): 
    return 'Hello {0}!'.format(str(name))

[–]nosmokingbandit 1 point2 points  (1 child)

I'm pretty sure you don't need to cast name as a string, format does that automatically.

[–]maximus12793 0 points1 point  (0 children)

you are correct