Python Forum
How do I add a number to every item in a list?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I add a number to every item in a list?
#1
Hey Guys,

I;m wondering how could I add a number to every single item in a list.

So for example. test1, test2 test3, test4

If i would have a range from 1 to 9

and add it to words like: test, number, pencil, etc.

I would like to see

test1, test2, test3, test4, test5, test6

number1, number2, number3, number4, number5, number6.

I would like this as an input and not printing it out...

Could you please help me out?

kind regards,

John
Reply


Messages In This Thread
How do I add a number to every item in a list? - by john316 - Oct-28-2020, 05:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Delete strings from a list to create a new only number list Dvdscot 8 1,594 May-01-2023, 09:06 PM
Last Post: deanhystad
  find random numbers that are = to the first 2 number of a list. Frankduc 23 3,300 Apr-05-2023, 07:36 PM
Last Post: Frankduc
  TypeError: float() argument must be a string or a number, not 'list' Anldra12 2 4,940 Jul-01-2022, 01:23 PM
Last Post: deanhystad
Question Finding string in list item jesse68 8 1,931 Jun-30-2022, 08:27 AM
Last Post: Gribouillis
  Split a number to list and list sum must be number sunny9495 5 2,349 Apr-28-2022, 09:32 AM
Last Post: Dexty
  Divide a number by numbers in a list. Wallen 7 8,112 Feb-12-2022, 01:51 PM
Last Post: deanhystad
  When did the number got included in the list? Frankduc 14 3,169 Feb-03-2022, 03:47 PM
Last Post: Frankduc
  how to easily create a list of already existing item CompleteNewb 15 3,660 Jan-06-2022, 12:48 AM
Last Post: CompleteNewb
  Remove an item from a list contained in another item in python CompleteNewb 19 5,868 Nov-11-2021, 06:43 AM
Last Post: Gribouillis
  count item in list korenron 8 3,541 Aug-18-2021, 06:40 AM
Last Post: naughtyCat

Forum Jump:

User Panel Messages

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