Last active
May 16, 2021 15:24
-
-
Save olumidayy/235365c85f96fd70303efd022ea08779 to your computer and use it in GitHub Desktop.
Algorithm Fridays
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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