It's not such a terrible thing, but you need to take into consideration other developers when coding. Even in school.
Your fellow developers should be able to see the exit clause for your loop, at the loop declaration. You didn't do that. You hid the exit clause in the middle of the loop, making more work for someone else who comes along and tries to understand your code. This is the same reason that things like "break" are avoided.
That being said, you'll still see things like this in a LOT of code out there in the real world.