Didn't you ask a similar topic last year
https://gbatemp.net/threads/are-teachers-allowed-to-swear-in-class-where-you-live.503954/ ?
Anyway it has been many years since I was in school. I was fortunate not to suffer the "you can't even call your classmate an idiot" thing that some schools seem to have gone in for these days.
It would have been a breakdown between different phases of school, and words available*. It would also depend upon whether it was lessons, what those lessons were ("hit the fucking ball" would probably not cause traumas in PE, this book is fucking shit probably not going to do well in maths) , breaktime, walking home (if you are in uniform and all that), in text unrelated to things (fortunately social media was not really a thing back then so we did not have the monitoring of it to deal with), directed at a fellow student, directed at staff, as a part of bullying, as an exclamation if you stubbed your toe and so on, as well as what teacher heard it**. I would be less expected that an 8 year old would be saying fuck and calling others a cunt (though such words were well known to all) in front of adults but by the time you were 15-16 it would probably only get you a tone your language down remark, or a detention if it was one of those "can't get you on one thing so I will get you on this" scenarios or otherwise particularly egregious.
At the time university was basically a job that you paid to be at and were treated as such, give or take access to some of the lab equipment without techs there, so it might have been unprofessional in certain settings but that was about it -- there was no coddling of developing minds or anything. Professors, phd students running labs and others you might have interacted with would all swear if they felt the need.
*UK swear word hierarchy is slightly different to US, Canada and antipodes, though probably close to Australian than US.
**my favourite was a home economics teacher*** was wandering up, guy I sort of knew a year below me was playing games on a computer (not a good plan at that point in time) so I hit the reset button (this was far back enough in time that computers still had turbo buttons). Him not seeing her wandering by told me to fuck off. She initially assumed it was me that swore ("do you know what that means?") but as my voice was rather different she realised her error and then the other guy copped to it (could have kept his mouth shut but he was probably 11 at the time so had not learned big boy lying and dealing with administration yet, might have also realised I had saved him some other trauma for the games). I think she backed off after a tongue lashing or maybe he got a detention but eh really.
***she and I never got along. However as I had been taught to cook by my parents the simplistic nonsense the school had us do was more boring than anything else so I acted aloof most of the time (such a thing was a pattern throughout my time in mandatory education), and did not see the benefit to arranging the drawers of cooking gear to standards you would otherwise see at the dining tables of £500 a head restaurants and they were real sticklers for that one. To this day I have never since seen such organisation and I have been in any number of professional kitchens and houses of people that cook.