# Unpacking Python's asterisk operator in Julia

**URL:** https://discourse.julialang.org/t/unpacking-pythons-asterisk-operator-in-julia/59498
**Category:** New to Julia
**Tags:** question, python
**Created:** [April 17, 2021, 8:48pm UTC](https://discourse.julialang.org/t/unpacking-pythons-asterisk-operator-in-julia/59498 "2021-04-17T20:48:43Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![amm](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@amm](https://discourse.julialang.org/u/amm)
#### Post date: [April 17, 2021, 8:48pm UTC](https://discourse.julialang.org/t/unpacking-pythons-asterisk-operator-in-julia/59498/1 "2021-04-17T20:48:43Z")

</div>

Hi everyone, I’ve been using Python recently, and I’ve discovered the asterisk operator, which expands the elements of an array where it’s used. For example, the two following usages of the variable _a_ are equivalent, being _func_ a function with two parameters:

```python
a = [1, 2]
func(a[0], a[1]) # explicit passing of the positional arguments
func(*a) # automatic unpacking of the positional arguments

```

I found it so useful, so I’m wondering about it exists something similar in Julia

---

<div class="post-metadata">

### Author: ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)
#### Post date: [April 17, 2021, 8:57pm UTC](https://discourse.julialang.org/t/unpacking-pythons-asterisk-operator-in-julia/59498/2 "2021-04-17T20:57:11Z")

</div>

In Julia, this is called [splatting](https://docs.julialang.org/en/v1/manual/functions/#Varargs-Functions), and is done by a `...` following the variable, e.g.

```julia
a = [1,2]
func(a...)

```

---

<div class="post-metadata">

### Author: ![amm](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@amm](https://discourse.julialang.org/u/amm)
#### Post date: [April 17, 2021, 8:59pm UTC](https://discourse.julialang.org/t/unpacking-pythons-asterisk-operator-in-julia/59498/3 "2021-04-17T20:59:57Z")

</div>

Thank you, it seems to be exactly the same
