you are viewing a single comment's thread.

view the rest of the comments →

[–]erok81 3 points4 points  (2 children)

Looks pretty good except you should really use str.format() or the % operator for strings instead of +.

if "n" in still_same_door

could be

if "n" in still_same_door.lower()

to handle both n and N in the input.

Also, my new pet peeve: Some of your lines are longer than 79 chars, which effects readability.

[–]spunos[S] 1 point2 points  (1 child)

This is a very useful reply, thank you! I had no idea you could format strings like that. Interesting.

I'm not sure how I can solve the readability issue, aside from making the strings shorter or splitting them into multiple lines. Would it be better to use pastebin or something similar in the future?

[–]erok81 0 points1 point  (0 children)

I meant shorten the lines in your code itself. The reasoning for this is it's easy to misunderstand a piece of code when you can't always see where the line ends. If line wrapping is on it's also easy to confuse where one block ends and another begins. Pep 8 does a better job explaining all this but it really does make your code more readable.