Build a User Profile From Keyword Arguments

Easy ⏱ 8 min 85% acceptance ★★★★★ 4.7
Write a function build_profile(**details) that accepts any number of keyword arguments and returns them as a plain dict, unchanged.

Examples

Example 1
Input
build_profile(name="Rahul", age=28)
Output
{'name': 'Rahul', 'age': 28}
Explanation

Each keyword argument becomes a key/value pair in the dict.

Constraints

  • Zero or more keyword arguments may be passed.

Topics

Functions**kwargs

Companies

MetaLinkedIn

Hints

Hint 1

**details collects keyword arguments into a dict automatically.

Hint 2

Just return that dict.

Loading the Python runtime… Run executes your code and shows printed output; Submit checks your function against this problem's examples.