# \[SOLVED\] Problem with while true loop (saying I need ':')

**URL:** <https://discourse.codecombat.com/t/solved-problem-with-while-true-loop-saying-i-need/11434>\
**Category:** Uncategorized\
**Created:** [May 15, 2017, 10:31am UTC](https://discourse.codecombat.com/t/solved-problem-with-while-true-loop-saying-i-need/11434 "2017-05-15T10:31:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Conan\_Middleton](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@Conan\_Middleton](https://discourse.codecombat.com/u/Conan_Middleton)\
**Post date:** [May 15, 2017, 10:31am UTC](https://discourse.codecombat.com/t/solved-problem-with-while-true-loop-saying-i-need/11434/1 "2017-05-15T10:31:32Z")

</div>

Hi everyone, I am having a problem with using while true loop.

I am writing while-true loop:

but after this, I am getting the exclamation mark error, and it says I need a ‘:’ after while true loop.

I am putting : at the end, and have also tried putting ‘:’

any idea what I am doing wrong? I am completely new to coding, so am probably making a simple mistake.

---

<div class="post-metadata">

**Author:** ![Conan\_Middleton](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@Conan\_Middleton](https://discourse.codecombat.com/u/Conan_Middleton)\
**Post date:** [May 15, 2017, 10:35am UTC](https://discourse.codecombat.com/t/solved-problem-with-while-true-loop-saying-i-need/11434/2 "2017-05-15T10:35:11Z")

</div>

My apologies, I have figured out my error.

I do not need to actually write loop, I just need to write-

while True:

Thank you all though, I am sure you will see me a lot on these forums, and I apologise in advance if I ask a lot of questions.

---

<div class="post-metadata">

**Author:** ![LokTin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/loktin/32/6276_2.png) [@LokTin](https://discourse.codecombat.com/u/LokTin)\
**Post date:** [May 16, 2017, 6:29am UTC](https://discourse.codecombat.com/t/solved-problem-with-while-true-loop-saying-i-need/11434/3 "2017-05-16T06:29:17Z")

</div>

For javascript is while True {}.

---

<div class="post-metadata">

**Author:** ![ajaxx99](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@ajaxx99](https://discourse.codecombat.com/u/ajaxx99)\
**Post date:** [May 31, 2017, 7:09pm UTC](https://discourse.codecombat.com/t/solved-problem-with-while-true-loop-saying-i-need/11434/4 "2017-05-31T19:09:57Z")

</div>

can you share the while true line please

---

<div class="post-metadata">

**Author:** ![\_TD\_RodYT](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/_td_rodyt/32/6285_2.png) [@\_TD\_RodYT](https://discourse.codecombat.com/u/_TD_RodYT)\
**Post date:** [May 31, 2017, 7:23pm UTC](https://discourse.codecombat.com/t/solved-problem-with-while-true-loop-saying-i-need/11434/5 "2017-05-31T19:23:30Z")

</div>

Please do not bring up dead topics.

In Python, a while loop is written like: `while True:`  
In Lua, a while loop is written like: `while true do`  
In JavaScript, a while loop is written like: `while (true) {`

---

<div class="post-metadata">

**Author:** ![ajaxx99](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@ajaxx99](https://discourse.codecombat.com/u/ajaxx99)\
**Post date:** [May 31, 2017, 8:47pm UTC](https://discourse.codecombat.com/t/solved-problem-with-while-true-loop-saying-i-need/11434/6 "2017-05-31T20:47:00Z")

</div>

thank you  
I just started and will not bring up “dead topics” in the future
