Q:For school we have to go swimming. Would this effect my fast?
A: You should try and excuse yourself if possible from swimming whilst fasting. Should the teacher not accept your excuse or you have no other choice then you may swim.
Swimming itself does not invalidate fasting. You should try an ensure that water does not go down your throat. Water seeping down your throat would require only a makeup for that given fast.
Allah Certainly Knows Best.