Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map not being egnerated due to iteration on empty list #18

Open
kn-f opened this issue Dec 23, 2019 · 1 comment
Open

Map not being egnerated due to iteration on empty list #18

kn-f opened this issue Dec 23, 2019 · 1 comment

Comments

@kn-f
Copy link

kn-f commented Dec 23, 2019

Hello,

I was following your tutorial (thanks a lot for it) and I've noticed that the code in part 3 is not generating a map and this is due to the fact that there's an iteration on an empty list which, for what I understood, python simply skips it.

Details:

@grogsy
Copy link

grogsy commented Apr 26, 2020

I found that the code in question is running a for/else loop. I initially experienced the same problem as well, but discovered I coded it incorrectly. I was able to fix it like so:

for other_room in rooms:
    ...
else:
    ...
    if num_rooms == 0:
        ...

Hope this helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants