Skip to content

Instantly share code, notes, and snippets.

@olumidayy
Last active May 16, 2021 15:24
Show Gist options
  • Save olumidayy/235365c85f96fd70303efd022ea08779 to your computer and use it in GitHub Desktop.
Save olumidayy/235365c85f96fd70303efd022ea08779 to your computer and use it in GitHub Desktop.
Algorithm Fridays
def shuffle_class(classArray, guide):
if not isinstance(classArray, list):
return []
if not isinstance(guide, int) or len(classArray) == 0:
return classArray
guide %= len(classArray)
return classArray[-guide:] + classArray[:-guide]
#print(shuffle_class([1,2,3,4,5,6,7], -4))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment