A Python function

Take your time, follow the code and check your understanding.

Move blocks into orderFunctions
  1. print(message)
  2. message = greet("Asha")
  3.     return "Hello " + name
  4. def greet(name):
Your answer3 min · no timer

Drag blocks, or use the arrow buttons. Keep the displayed indentation. This task uses the taught sequence; other equivalent programs may also be valid.

Show solution and explanation

Define the function, call it, then print the returned message.

def greet(name):
    return "Hello " + name
message = greet("Asha")
print(message)