# Why am I getting five vectors instead of one?

**URL:** https://discourse.julialang.org/t/why-am-i-getting-five-vectors-instead-of-one/66822
**Category:** New to Julia
**Created:** [August 22, 2021, 11:47pm UTC](https://discourse.julialang.org/t/why-am-i-getting-five-vectors-instead-of-one/66822 "2021-08-22T23:47:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![cybervigilante](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cybervigilante/32/26687_2.png) [@cybervigilante](https://discourse.julialang.org/u/cybervigilante)
#### Post date: [August 22, 2021, 11:47pm UTC](https://discourse.julialang.org/t/why-am-i-getting-five-vectors-instead-of-one/66822/1 "2021-08-22T23:47:44Z")

</div>

```julia
arr = []
[push!(arr,Char(ch)) for ch in "flarp"]

```

5-element Vector{Vector{Any}}:  
[‘f’, ‘l’, ‘a’, ‘r’, ‘p’]  
[‘f’, ‘l’, ‘a’, ‘r’, ‘p’]  
[‘f’, ‘l’, ‘a’, ‘r’, ‘p’]  
[‘f’, ‘l’, ‘a’, ‘r’, ‘p’]  
[‘f’, ‘l’, ‘a’, ‘r’, ‘p’]

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [August 23, 2021, 12:05am UTC](https://discourse.julialang.org/t/why-am-i-getting-five-vectors-instead-of-one/66822/2 "2021-08-23T00:05:32Z")

</div>

Please, quote your code with triple backquotes: Discourse is doing lots of automagic rendering, it took me a while to figure out was an empty vector `[]`.

The fact is that [`push!`](https://docs.julialang.org/en/v1/base/collections/#Base.push!) returns the collection you’re pushing to, so each element of the [comprehension](https://docs.julialang.org/en/v1/manual/arrays/#man-comprehensions) is `arr`, so the final result is

```julia
[arr, arr, arr, arr, arr]

```

with `arr` being

```julia
Any['f', 'l', 'a', 'r', 'p']

```

Also, note that you are getting _a_ vector at the end, but it’s a vector of vectors
