15. Turn location


The instructions tell us to print turn + 1 at the bottom, but I feel it should be at the top of turn in range section of our code. Otherwise we always end up one turn short. It will read only 3 turns, when in fact we guessed 4 times.

I feel my code below is the more correct way of doing this exercise, but I'm a student, and am wondering if there is a better reason why codecademy tells us to put it at the bottom? Am I over looking something here? Any feedback is appreciated. Thanks in advance!


Replace this line with your code. 
for turn in range(4):
    print "Turn",(turn + 1)
    guess_row = int(raw_input("Guess Row:"))
    guess_col = int(raw_input("Guess Col:"))



Your choice to put the "turn" print statement at the top is very intuitive. It would make sense that you could see your turn number before you make your guess, so you know how many you have left!

There is no specific reason for the print statement to come at the end; I believe it is just because of how the lesson was structured. They have you add the print statement after setting up the conditional block and therefore just made it an easy addition.

Either way works, but yours certainly makes logical sense :slight_smile:

Happy coding.


@wowpalvabbit Thanks for the explanation. Happy coding :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.