0
Help with code coach 37.2 "Welcome, Solo learner!" in Python for Beginners please.
I know I'm missing something and it's probably so easy that I'll kick myself for not catching it, but could I get another set of eyes on this please? The problem: We have a function that outputs "Welcome, user" as it is called. We want to make it more personalized, so redesign the given function so that it will take the name of the user as input and output the welcome message with it. Sample Input Tommy Sample Output Welcome, Tommy My code: def welcome(name): print("Welcome,"+name) name = input () welcome(name) Any help would be very much appreciated!
11 ответов
+ 3
This following code should work:
def welcome_message():
name = input()
print("Welcome, "+ name)
welcome_message()
+ 1
Thank you! It was the space, you were right. I knew it would be something stupid easy that I had overlooked
0
0
Try this:
user=input()
def welcome():
print("Welcome,",user)
welcome()
0
For me it's printing welcome Bob
0
Can any one help me
0
def welcome_message():
name = input()
print("Welcome,",name)
welcome_message()
0
def welcome_user(name):
print("Welcome,",user_name)
# Example usage:
user_name = input()
welcome_user(user_name)
This is the original answer!!!!
I got it.. And you can just try it out.
- 1
May be space missing : try
print("Welcome," , name)
or
print("Welcome, "+ name)
- 1
def welcome_message():
name = input()
print("Welcome,",name)
welcome_message()
done...!
- 1
def welcome_message():
name = input()
print("Welcome,",name)
welcome_message()
This is Correct...