1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Python for Developers

Connected

Exercise

Adding arbitrary arguments

Python allows custom functions to accept any number of positional arguments through the use of "Arbitrary arguments". This flexibility enables functions to be used in a variety of ways while still producing the expected results.

Using this power, you'll build a function that concatenates (joins together) strings, regardless of how many blocks of text are provided!

Instructions

100 XP
  • Define a function called concat() that accepts arbitrary arguments called args.
  • Use a for loop to iterate over each arg in args.
  • Call the function to test that it works correctly.