Bad Aim, My code is accepted but doesnt function properly


#1



https://www.codecademy.com/en/courses/python-beginner-en-4XuFm/1/3?curriculum_id=4f89dab3d788890003000096


So on my first try I missed the information box on how the code should be written:


if x not in range(8) or \
   y not in range(3):
        print "Outside the range"


so I wrote this code instead


if not guess_row == range(5) or not guess_col == range(5):
        print "Oops, that's not even in the ocean."


As I said, my code is being accepted and I can move on, however, when I enter coordinates that are within the board, it still prints "Oops, thats not even in the ocean."

Any ideas on how it could be accepted and what makes my code not function properly?


#2

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