-7
Real quick question about the "break"
(sh.itjust.works)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
I want to add that you should consider that your teacher is teaching you fundamentals of programming. break and continue are often options to use, but you shouldn't try to solve everything with them. You are probably writing pretty basic functions in class right now where it doesn't really matter, but with more complex problems break and continue constructions might easily get pretty messy.
Also your teacher has a plan what to teach you over the whole semester. If recursion is part of this plan it's valid she wants you to understand the basics of calling functions first. This might be overkill for easy problems but it could help you to be a better programmer in the future.