Home > Back-end >  Printing a list into blocks of letters - Python
Printing a list into blocks of letters - Python

Time:06-14

Still new to Python so my apologies.. I'm trying to print out a list into blocks of letters. Specifically 7, but I'm not sure how to remove the commas and lines.

What I currently have

for index in range(0, len(populatedList), 7) :
print (populatedList[index:index 7])

What I'm trying to get

CodePudding user response:

Following should work:

for index in range(0, len(populatedList), 7) :
  print ("".join(populatedList[index:index 7]))
  • Related