# Having trouble with the parse function

**URL:** <https://discourse.julialang.org/t/having-trouble-with-the-parse-function/139108>\
**Category:** General Usage\
**Created:** [August 30, 2026, 9:20pm UTC](https://discourse.julialang.org/t/having-trouble-with-the-parse-function/139108 "2026-08-30T21:20:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guel](https://avatars.discourse-cdn.com/v4/letter/g/919ad9/32.png) [@Guel](https://discourse.julialang.org/u/Guel)\
**Post date:** [August 30, 2026, 9:20pm UTC](https://discourse.julialang.org/t/having-trouble-with-the-parse-function/139108/1 "2026-08-30T21:20:59Z")

</div>

Hey all,

I´m trying to make a very simple code where the user types a radius and julia returns the calculated area and circumference of a circle with that radius.

println(“circle.jl”); println(“Escolha um raio”); raio = readline(); parse(Int64, raio); print(2\*_π_\*_raio); print(2\*π_\*raio)

However, it says there is a Method Error; no method matching. What is the problem here?  
Also, i´d love suggestions of better/simpler ways to write the code if you have any. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![BananaMaster3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bananamaster3/32/218457_2.png) [@BananaMaster3](https://discourse.julialang.org/u/BananaMaster3)\
**Post date:** [August 31, 2026, 12:49am UTC](https://discourse.julialang.org/t/having-trouble-with-the-parse-function/139108/2 "2026-08-31T00:49:46Z")

</div>

Parse does not mutate the variable passed into it. Instead, it returns the parsed output. You can tell this because it does not have an exclamation point at it’s end: `push!(vec::Vector, var)` modifies vec, but `parse` does not.

So the real error is `raio` staying as a String. Then when you try to multiply it by 2π, the compiler errors, because Int64\*String is not defined.

If you save the output of `parse` to a variable, this should work:

```julia-auto
println("circle.jl")
println("Escolha um raio")
raio = readline()
parsed_raio = parse(Int64, raio)
print(2*π*parsed_raio)
print(2*π*parsed_raio)

```

P.S.  
You can use ` or ``` to make your code more readable and copyable!

---

<div class="post-metadata">

**Author:** ![Guel](https://avatars.discourse-cdn.com/v4/letter/g/919ad9/32.png) [@Guel](https://discourse.julialang.org/u/Guel)\
**Post date:** [August 31, 2026, 4:29am UTC](https://discourse.julialang.org/t/having-trouble-with-the-parse-function/139108/3 "2026-08-31T04:29:26Z")

</div>

Thank you soo much for the help!
