Last active
October 13, 2016 20:04
-
-
Save Parassharmaa/f4cf20c8bf6a1cfd805998d0a18e547e to your computer and use it in GitHub Desktop.
python program to divide string in equal sub-string and print in sorted form.
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 mul(s): | |
l = len(s) | |
for i in range(2, l): | |
if l%i==0: | |
return(i) | |
break | |
else: | |
return 1 | |
s = input("Input String:") | |
n = mul(s) | |
sd = [] | |
for i in range(0,len(s), n): | |
sd.append(s[i:i+n]) | |
sd.sort() | |
for i in sd: | |
print(i) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment