This is the code in question:
def find_next(pos):
for gate in gateway:
for i in links:
if (pos, gate) == i or (gate, pos) == i:
links.pop(links.index(i))
return f"{pos} {gate}"
return 0
while True:
si = int(input())
if find_next(si) != 0:
print(find_next(si))
else:
print("0 9")
Basicaly i’m trying to find the the next position, if i can’t find it in the find_next() function it should return 0.
Latter in the code i’m checking if the find_next() function return 0 or not, if it doesn’t return 0 I whant to print it, if it does return 0 i whant to print “0 9”.
But for some reason it is printing 0, what shoudn’t happen, because if find_next() is 0 it should print “0 9” instead of itself.
Tried the same code on PyCharm, it worked fine.
this is the challenge i’m facing this issue
this is my code in case you wanna try to reproduce