Python Forum

Full Version: Reading string groups of 3.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Im trying to print out groups of three of the string. the code i have so far only prints out every third letter. Example: a d l j... I want it to print out abc ded lsf....

y="abcdedlsfjldsjflsdjfslfj"
u=len(y)

for x in range(0,u,3):
    print(y[x],'\n')
Show the code you have so far so we can point out the errors
Thats the only code i have so far.