diff --git a/libs/pxt-python/pxt-python-helpers.ts b/libs/pxt-python/pxt-python-helpers.ts index 7f820bd5d873..adeda9a48542 100644 --- a/libs/pxt-python/pxt-python-helpers.ts +++ b/libs/pxt-python/pxt-python-helpers.ts @@ -361,7 +361,7 @@ namespace _py { if (index == undefined) { return arr.pop(); } - else if (index > 0 && index < arr.length) { + else if (index >= 0 && index < arr.length) { return arr.removeAt(index | 0); }