Skip to content

Instantly share code, notes, and snippets.

View Sijibomii's full-sized avatar

Sijibomi Ajayi Sijibomii

View GitHub Profile
@Sijibomii
Sijibomii / shuffleAlgo.py
Created May 15, 2021 10:11
ALGORITHM FIDAYS
def shuffleClass(pupilsList, noToBeMoved):
# validate inputs first
#check if pupils list is a valid list
if not isinstance(pupilsList, list):
return []
#check if noToBeMoved is a valid integer
if not isinstance(noToBeMoved, int):
return pupilsList
classSize = len(pupilsList)
#if pupils list contains just one element or noToBeMoved is zero return it