13 odpowiedzi
+ 8
# add this as the last line: (NOT INDENTED)
welcome_message()
# you defined a function and just didn't call it
+ 6
Call the function
+ 4
thx guys
+ 3
"call a function" means "use it in your script"
+ 2
Just type welcome_message()
+ 2
Jackson Jameson
Like this
def welcome_message():
#redesign this function
name = input()
print("Welcome,"+name)
welcome_message()
+ 2
You just need to include the call statement (welcome_message())to your code
+ 2
def welcome_message():
#redesign this function
name = input()
print("Welcome,"+name)
welcome_message()
==================================
OR
def welcome_message(name):
print("welcome", name)
#call function with argument
name= input()
welcome_message(name)
+ 1
Instead of print("Welcome,"+name)
You can use print(f"Welcome {name}")
0
i do not know how to call it I have tried but I don't understand how
0
def welcome_message():
#redesign this function
name = input()
return f"Welcome, {name}"
print(welcome_message())
This should pretty much solve the task.
Your code isn't wrong, the only problem is that you did not call your function after creating it.
N/B in order for your function to work, you have to call it
0
username=input("please input your name")
print(f'welcome {username}')
0
Maynul ,when we make a big program putting (,) or (+) to connected the strings. the (,) or (+) become a night Mayor so i am tell you the smart way to do that. thank you.