Python Forum
how do i get rid of next lines in my list()
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how do i get rid of next lines in my list()
#6
If the empty strings had a space, so not really empty, then you iterate through each of them using a for loop and add it to an already created string variable, like with the list code that I showed you. string += character but from the looks of it, the empty strings, are well, empty. So when iterating through all the characters, write an if statement that if the string is empty, add a just a space, else, add the character. Since your new to coding it's best for you to try making the code yourself this time.
Reply


Messages In This Thread
RE: how do i get rid of next lines in my list() - by SheeppOSU - Mar-29-2020, 08:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Iterate 2 large text files across lines and replace lines in second file medatib531 13 6,155 Aug-10-2020, 11:01 PM
Last Post: medatib531
  25 blank lines in my sorted_fruits output list! raven61 7 4,403 Aug-09-2018, 11:30 PM
Last Post: raven61
  storing lines from stdin in a list bghosh 2 3,078 May-02-2018, 01:12 PM
Last Post: gruntfutuk
  How to list objects on separate lines? Intelligent_Agent0 3 4,211 Jan-10-2018, 05:35 AM
Last Post: Intelligent_Agent0
  printing a list of lines Skaperen 7 4,668 Jul-30-2017, 03:28 AM
Last Post: Skaperen
  Print list items on separate lines with additional text DBS 2 6,228 Jan-11-2017, 02:57 AM
Last Post: DBS

Forum Jump:

User Panel Messages

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