1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Functions in Python

Connected

Exercise

Single-parameter functions

Congratulations! You have successfully defined and called your own function! That's pretty cool.

In the previous exercise, you defined and called the function shout(), which printed out a string concatenated with '!!!'. You will now update shout() by adding a parameter so that it can accept and process any string argument passed to it. Also note that shout(word), the part of the header that specifies the function name and parameter(s), is known as the signature of the function. You may encounter this term in the wild!

Instructions

100 XP
  • Complete the function header by adding the parameter name, word.
  • Assign the result of concatenating word with '!!!' to shout_word.
  • Print the value of shout_word.
  • Call the shout() function, passing to it the string, 'congratulations'.