> For the complete documentation index, see [llms.txt](https://lei-d.gitbook.io/leetcode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lei-d.gitbook.io/leetcode/python-tips/receiving-tuples-and-dictionaries-as-function-parameters.md).

# Receiving Tuples and Dictionaries as Function Parameters

If we need to take variable number of arguments in the function, we can use the \* and \*\* prefix to indicate receiving tuple and dictionary.

```python
>>> def powersum(power, *args):
... '''Return the sum of each argument raised to the specified
power.'''
...     total = 0
...     for i in args:
...         total += pow(i, power)
...         return total
...
>>> powersum(2, 3, 4)
25
>>> powersum(2, 10)

100
```
