Python Forum
How to make for loop display on 1 Line
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make for loop display on 1 Line
#2
I don't know what results contain but seeing that you're looping might could use a join
results = ['Blah', 'blah', 'blah', 'Wikipedia', 'info']
text = f'Baxter: {" ". join(results)}'
print(text)
Output:
Baxter: Blah blah blah Wikipedia info
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags


Reply


Messages In This Thread
How to make for loop display on 1 Line - by Extra - Jan-12-2022, 08:40 PM
RE: How to make for loop display on 1 Line - by menator01 - Jan-12-2022, 08:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to display <IPython.core.display.HTML object>? pythopen 3 46,116 May-06-2023, 08:14 AM
Last Post: pramod08728
  Trying to loop through code to plot seaborn line plots across multiple subplots eyavuz21 0 1,725 Dec-05-2022, 10:46 AM
Last Post: eyavuz21
  Skipping line in text without Restarting Loop IdMineThat 4 1,536 Apr-05-2022, 04:23 AM
Last Post: deanhystad
  How to prevent python from going to new line in for loop? idknuttin 3 4,998 Feb-11-2022, 05:40 AM
Last Post: deanhystad
  Looking for discord bot to make loop ping for address ip tinkode 0 1,848 Jul-26-2021, 03:51 PM
Last Post: tinkode
  How to make input come after input if certain line inserted and if not runs OtherCode Adrian_L 6 3,373 Apr-04-2021, 06:10 PM
Last Post: Adrian_L
Information Unable to display joystick's value from Python onto display box MelfoyGray 2 2,275 Nov-11-2020, 02:23 AM
Last Post: MelfoyGray
  For loop to make it easier Amirdst 2 2,095 Apr-28-2020, 04:12 PM
Last Post: Yoriz
  How to make input goto a different line mxl671 2 2,490 Feb-04-2020, 07:12 PM
Last Post: Marbelous
  How to Display Multiple Time Tables With While Loop ZQ12 2 2,206 Nov-10-2019, 04:15 AM
Last Post: ZQ12

Forum Jump:

User Panel Messages

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