السلام عليكم ورحمة الله وبركاته أحسن الله إليكم What to do in PE when teams are assigned by a teacher, there is most likely one or two people who swear and not everyone is Muslim?

Ustadh AbdulAziz al-Haqqan
A team the teacher assigns you is not a sitting you chose, if they give you the choice not to participate, then don't. If it is mandatory then try to stay away from that which is forbidden as much as possible.