# Can \`π\` be used as a general variable name?

**URL:** <https://discourse.julialang.org/t/can-be-used-as-a-general-variable-name/112400>\
**Category:** General Usage\
**Tags:** question\
**Created:** [April 2, 2024, 6:22am UTC](https://discourse.julialang.org/t/can-be-used-as-a-general-variable-name/112400 "2024-04-02T06:22:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Post date:** [April 2, 2024, 6:22am UTC](https://discourse.julialang.org/t/can-be-used-as-a-general-variable-name/112400/1 "2024-04-02T06:22:13Z")

</div>

```julia
julia> π = 1
ERROR: cannot assign a value to imported variable MathConstants.π from module Main

```

I know `π` is the circular constant, but is it always a reserved variable in Julia? Can I borrow it temporarily?

---

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [April 2, 2024, 6:33am UTC](https://discourse.julialang.org/t/can-be-used-as-a-general-variable-name/112400/2 "2024-04-02T06:33:58Z")

</div>

You can assign to it, just not if you have already imported it from another module.

```julia
julia> π = 1
1

```

---

<div class="post-metadata">

**Author:** ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Post date:** [April 2, 2024, 6:50am UTC](https://discourse.julialang.org/t/can-be-used-as-a-general-variable-name/112400/3 "2024-04-02T06:50:40Z")

</div>

I see. You mean once I have used `π` as the circular constant, I will not be able to assign any other number to it?

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [April 2, 2024, 6:52am UTC](https://discourse.julialang.org/t/can-be-used-as-a-general-variable-name/112400/4 "2024-04-02T06:52:54Z")

</div>

Julia will prove popular in Indiana in this case

[https://cs.uwaterloo.ca/~alopez-o/math-faq/mathtext/node18.html](https://cs.uwaterloo.ca/~alopez-o/math-faq/mathtext/node18.html)

---

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [April 2, 2024, 7:00am UTC](https://discourse.julialang.org/t/can-be-used-as-a-general-variable-name/112400/5 "2024-04-02T07:00:12Z")

</div>

Once you have imported `π` as the circle constant (or any other value) in a given module, you will not be able to assign any other number to it in that module.

---

<div class="post-metadata">

**Author:** ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Post date:** [April 2, 2024, 7:02am UTC](https://discourse.julialang.org/t/can-be-used-as-a-general-variable-name/112400/6 "2024-04-02T07:02:19Z")

</div>

Well, I see. Many thanks! 🤝 🤝
