# Changing variables in a loop

**URL:** <https://forum.elixirforum.com/t/changing-variables-in-a-loop/43526>\
**Category:** Questions\
**Tags:** troubleshooting\
**Created:** [November 1, 2021, 9:07am UTC](https://forum.elixirforum.com/t/changing-variables-in-a-loop/43526 "2021-11-01T09:07:00Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![derek-zhou](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/derek-zhou/32/19943_2.png) [@derek-zhou](https://forum.elixirforum.com/u/derek-zhou)\
**Post date:** [November 1, 2021, 8:15pm UTC](https://forum.elixirforum.com/t/changing-variables-in-a-loop/43526/9 "2021-11-01T20:15:44Z")

</div>

A `cond do ...` will raise if none of the conditions hold true. This is safer for newbies than `if` that don’t have a `else` clause.

---

_[View the full topic](https://forum.elixirforum.com/t/changing-variables-in-a-loop/43526)._
