Basic For loops don’t work (While loops are fine though)
Expected vs Current Behavior:
Print each element of sequence, but prints nothing
Steps to reproduce:
for i in range(0,5+1,1):
for i in range(5,0-1,-1):
Bug appears at this link: https://replit.com/@jegendron/All-In-Class-Code-L1-Python#main.py
Browser/OS/Device: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/18.104.22.168 Safari/537.36
Replit Profile: https://replit.com/@jegendron
The problem must be related to something else as the code should work.
Difficult to understand on your repl (apart that there is an error on the whole code before as the if will never be executed)
Did you try to put the code in a separate file and let it run with run or via shell with the command python filename.py?
this looks like a problem with the nix migration creating an invalid configuration. @coltonatreplit
- Click Files > ⋮ > Show hidden files
- In the
.replit file, replace lines 27-29 with
args = [
Create another repl and move the code there only the code.
hi Umar, was this repl created from a template or was it migrated to nix?
nevermind, it’s a nix migration. the problem was a stale migration configuration. thanks for pointing it out!