Last active
January 11, 2022 20:04
-
-
Save Dbhardwaj99/7a2b5de41fda5d6dea8dd76e45bbf7f9 to your computer and use it in GitHub Desktop.
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 flo_sorting(list): | |
length = len(list) | |
i = a = b = c = d = e = 0 | |
list2 = [] | |
newlist = [] | |
while i != length: | |
if list[i][-1] == ':': | |
e = list[i] | |
list2 = list[i+1:] | |
list2 = flo_sorting(list2) | |
break | |
elif list[i][-1] == '#': | |
a = list[i] | |
elif list[i][-1] == '*': | |
b = list[i] | |
elif list[i][-1] == '$': | |
c = list[i] | |
elif list[i][-1] == '@': | |
d = list[i] | |
else: | |
break | |
i = i+1 | |
if d != 0: | |
newlist.append(d) | |
if b != 0: | |
newlist.append(b) | |
if a != 0: | |
newlist.append(a) | |
if c != 0: | |
newlist.append(c) | |
if e != 0: | |
newlist.append(e) | |
if list2 == []: | |
return newlist | |
else: | |
newlist = newlist+list2 | |
return newlist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks amazing , honestly well thought out