# Function returning "(nothing, nothing,...)" after returning some strings

**URL:** https://discourse.julialang.org/t/function-returning-nothing-nothing-after-returning-some-strings/90789
**Category:** New to Julia
**Tags:** question
**Created:** [November 25, 2022, 4:33am UTC](https://discourse.julialang.org/t/function-returning-nothing-nothing-after-returning-some-strings/90789 "2022-11-25T04:33:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![XavierJack](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xavierjack/32/44626_2.png) [@XavierJack](https://discourse.julialang.org/u/XavierJack)
#### Post date: [November 25, 2022, 4:33am UTC](https://discourse.julialang.org/t/function-returning-nothing-nothing-after-returning-some-strings/90789/1 "2022-11-25T04:33:55Z")

</div>

I am new to Julia and posting to forums so please excuse any bad formatting, I have some background with python so I have been trying to translate my python code to Julia which led me to being confused why this code is returning (nothing, nothing,…) after it returns what i wanted it to return

I was thinking it was due to the "println()"s but i went in and changed them to “print()” and added the \n inside it but it still prints out the same thing.

```julia
function sign()
ran = rand(1:2)  
if ran == 1
        return (println(" ____________  ____  ______"),
    println("/\\ ___\\ /\\___ \\ /\\ \\/\\ \\ /\\ ___\\ "),
    println("\\/_/ / __\\ \\__ \\ \\ \\ \\_\\ \\ \\ \\___ \\ "),
    println(" /\\ _____\\ \\ \\_____ \\ \\ \\ _____\\ \\/\\_____ \\ "),
    println(" \\/ _____/ \\/_____ / \\/ _____/ \\/_____ / "))
else
    return (println(" _/_/_/_/_/ "),
    println(" _/ _/_/ _/ _/ _/_/_/ "),
    println(" _/ _/_/_/_/ _/ _/ _/_/ "),
    println(" _/ _/ _/ _/ _/_/ "),
    println("_/_/_/_/_/ _/_/_/ _/_/_/ _/_/_/ "))
end
end

sign()

```

Which returns this

![Screenshot 2022-11-24 221848](https://global.discourse-cdn.com/julialang/original/3X/7/f/7fccf0d1444e173b5b2c8a312bcdc075aac583df.jpeg)

---

<div class="post-metadata">

### Author: ![johnmyleswhite](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnmyleswhite/32/31_2.png) [@johnmyleswhite](https://discourse.julialang.org/u/johnmyleswhite)
#### Post date: [November 25, 2022, 4:53am UTC](https://discourse.julialang.org/t/function-returning-nothing-nothing-after-returning-some-strings/90789/2 "2022-11-25T04:53:42Z")

</div>

The return value of `print` is `nothing`. This is conventional in Julia for functions used for their side effects, rather than their values.

Why are you calling print inside a return statement? That’s quite unusual in every language I’ve used, including Python.

---

<div class="post-metadata">

### Author: ![thautwarm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thautwarm/32/37760_2.png) [@thautwarm](https://discourse.julialang.org/u/thautwarm)
#### Post date: [November 25, 2022, 5:33am UTC](https://discourse.julialang.org/t/function-returning-nothing-nothing-after-returning-some-strings/90789/3 "2022-11-25T05:33:14Z")

</div>

I think your Python code should also return a tuple of `None`.

```julia
def sign():
    ...
    return (print("---"), print("___"), ..., )

```

---

<div class="post-metadata">

### Author: ![mgp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mgp/32/28599_2.png) [@mgp](https://discourse.julialang.org/u/mgp)
#### Post date: [November 25, 2022, 9:28am UTC](https://discourse.julialang.org/t/function-returning-nothing-nothing-after-returning-some-strings/90789/4 "2022-11-25T09:28:02Z")

</div>

I’m not sure if I’ve understood the question. Does this do what you want?

```julia
function sign()
    ran = rand(1:2)  
    if ran == 1
        println(" ____________  ____  ______"),
        println("/\\ ___\\ /\\___ \\ /\\ \\/\\ \\ /\\ ___\\ "),
        println("\\/_/ / __\\ \\__ \\ \\ \\ \\_\\ \\ \\ \\___ \\ "),
        println(" /\\ _____\\ \\ \\_____ \\ \\ \\ _____\\ \\/\\_____ \\ "),
        println(" \\/ _____/ \\/_____ / \\/ _____/ \\/_____ / ")
    else
        println(" _/_/_/_/_/ "),
        println(" _/ _/_/ _/ _/ _/_/_/ "),
        println(" _/ _/_/_/_/ _/ _/ _/_/ "),
        println(" _/ _/ _/ _/ _/_/ "),
        println("_/_/_/_/_/ _/_/_/ _/_/_/ _/_/_/ ")
    end
    return
end

```
