# Pop(0) method bug

**URL:** <https://discourse.codecombat.com/t/pop-0-method-bug/12353>\
**Category:** Bugs\
**Created:** [September 3, 2017, 5:07pm UTC](https://discourse.codecombat.com/t/pop-0-method-bug/12353 "2017-09-03T17:07:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SiMaX](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@SiMaX](https://discourse.codecombat.com/u/SiMaX)\
**Post date:** [September 3, 2017, 5:07pm UTC](https://discourse.codecombat.com/t/pop-0-method-bug/12353/1 "2017-09-03T17:07:59Z")

</div>

The `pop(0)` method doesn’t remove an element in “Prime Pathing” level, instead it removes last one. Bug also mentioned [here](https://discourse.codecombat.com/t/adventurer-queue-manager/12209/10?u=simax).

---

<div class="post-metadata">

**Author:** ![byobcello](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/byobcello/32/6684_2.png) [@byobcello](https://discourse.codecombat.com/u/byobcello)\
**Post date:** [September 3, 2017, 6:59pm UTC](https://discourse.codecombat.com/t/pop-0-method-bug/12353/2 "2017-09-03T18:59:35Z")

</div>

Specifically, this applies to Python.

This bug exists on every level.

[Link to issue on GitHub](https://github.com/differentmatt/filbert/issues/80)

---

<div class="post-metadata">

**Author:** ![SiMaX](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@SiMaX](https://discourse.codecombat.com/u/SiMaX)\
**Post date:** [September 3, 2017, 7:12pm UTC](https://discourse.codecombat.com/t/pop-0-method-bug/12353/3 "2017-09-03T19:12:00Z")

</div>

Alternative:

```python
for item in list:
    list.remove(item)

```

---

<div class="post-metadata">

**Author:** ![Shmoogy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/shmoogy/32/6770_2.png) [@Shmoogy](https://discourse.codecombat.com/u/Shmoogy)\
**Post date:** [September 27, 2017, 7:41am UTC](https://discourse.codecombat.com/t/pop-0-method-bug/12353/4 "2017-09-27T07:41:07Z")

</div>

I would like to thank you quite a bit for that relatively simple observation. I’d been banging my head into “Queue Manager” for ages, getting really stuck where I was supposed to use the `pop`, and just seeing that really made it all click.
