Skip to content

Instantly share code, notes, and snippets.

@Parassharmaa
Last active October 13, 2016 20:04
Show Gist options
  • Save Parassharmaa/f4cf20c8bf6a1cfd805998d0a18e547e to your computer and use it in GitHub Desktop.
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.
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