Python Forum
[split] Automate the boring stuff, inserting commas in list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] Automate the boring stuff, inserting commas in list
#2
What are you trying to do. Put a comma at the end of each element?
>>> [f'{element},' for element in d]
['apple,', 'banana,', 'tofu,', 'cat,']
Recommended Tutorials:
Reply


Messages In This Thread
RE: [split] Automate the boring stuff, inserting commas in list - by metulburr - Jul-02-2019, 02:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] why can't i create a list of numbers (ints) with random.randrange() astral_travel 7 1,428 Oct-23-2022, 11:13 PM
Last Post: Pedroski55
  Split string using variable found in a list japo85 2 1,235 Jul-11-2022, 08:52 AM
Last Post: japo85
  help with commas in print functions kronhamilton 11 3,344 Feb-10-2022, 02:02 PM
Last Post: mishraakash
  Run the code for some stuff it does not return me why Anldra12 3 2,797 Apr-19-2021, 02:01 PM
Last Post: Anldra12
  "Automate the Boring Stuff with Python" creating a path works but only for CMD promt Milos 2 2,821 Nov-28-2020, 01:08 PM
Last Post: Larz60+
  Unable to print stuff from while loop Nick1507 4 2,275 Sep-17-2020, 02:26 PM
Last Post: Nick1507
  How Do I Install Stuff for Python? CopBlaster 6 3,131 May-08-2020, 12:27 PM
Last Post: hussainmujtaba
  Learning to have Class and doing stuff with it... bako 2 1,955 Apr-29-2020, 05:07 PM
Last Post: bako
  [split] question about list comprehension Armin 17 5,521 Jan-29-2020, 04:32 PM
Last Post: Clunk_Head
  split the list SriRajesh 2 2,170 Jan-01-2020, 07:07 PM
Last Post: perfringo

Forum Jump:

User Panel Messages

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