in-class python exercise 1

Exercise · Explain This Python Function (Greeting Message)

Python · Beginner
Explain this code out loud like you're speaking during a technical interview. Focus on the function, parameter, string concatenation, and returned value.
def greet_user(name):
    message = "Hello, " + name
    return message

print(greet_user("Robbie"))
🎯 Instructions oral task
  1. Explain what the function does.
  2. Describe what the parameter represents.
  3. Explain how the string is created.
  4. Explain what the return statement does.
  5. Explain what gets printed to the console.
📖 Vocabulary core
  • function — reusable block of code that performs a task.
  • parameter — input value passed into a function.
  • string — text data inside quotation marks.
  • concatenation — combining multiple strings together.
  • return value — value sent back from a function.
  • console output — text displayed on the screen.
🧩 Collocations natural English
  • define a function
  • pass in a parameter
  • return a value
  • concatenate strings together
  • print the result
  • store data in a variable
🗣️ Phrasal Verbs interview speech
  • pass in — “We pass in a name as input.”
  • print out — “The program prints out the greeting message.”
  • build up — “The function builds up a custom string.”
  • send back — “The function sends back the final value.”
🎤 Model Answer spoken

This function is called greet_user. It takes one parameter called name, which represents the user's name.

Inside the function, a variable called message is created. The code combines the text "Hello, " with the value of the name parameter using string concatenation.

After that, the function returns the completed message. Finally, the print() statement calls the function with the value "Robbie" and displays the result in the console.

The final output would be Hello, Robbie.