Python Forum
Reading string groups of 3.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reading string groups of 3.
#1
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')
Reply
#2
Show the code you have so far so we can point out the errors
Reply
#3
Thats the only code i have so far.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Reading a text until matched string and print it as a single line cananb 1 1,997 Nov-29-2020, 01:38 PM
Last Post: DPaul

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020