Python Forum
create list from repeated pattern in python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
create list from repeated pattern in python
#2
You could use list comprehension
L = [pattern(i) for i in range(n)]
Reply


Messages In This Thread
RE: create list from repeated pattern in python - by Gribouillis - Sep-25-2018, 09:30 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with Python Script to generate SVG Dot Matrix Pattern for LED Light Guide iamrickm 2 800 Aug-25-2023, 06:07 PM
Last Post: iamrickm
  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
  [split] why can't i create a list of numbers (ints) with random.randrange() astral_travel 7 1,574 Oct-23-2022, 11:13 PM
Last Post: Pedroski55
  how to easily create a list of already existing item CompleteNewb 15 3,659 Jan-06-2022, 12:48 AM
Last Post: CompleteNewb
  Create SQLite columns from a list or tuple? snakes 6 8,815 May-04-2021, 12:06 PM
Last Post: snakes
  Create variable and list dynamically quest_ 12 4,503 Jan-26-2021, 07:14 PM
Last Post: quest_
  How to create a linked list and call it? loves 12 4,642 Nov-22-2020, 03:50 PM
Last Post: loves
  Remove specific elements from list with a pattern Xalagy 3 2,743 Oct-11-2020, 07:18 AM
Last Post: Xalagy
  How to create and define in one line a 2D list of class objects in Python T2ioTD 1 2,072 Aug-14-2020, 12:37 PM
Last Post: Yoriz
  How to define a function to create a resorted list? sparkt 6 2,870 Aug-08-2020, 04:10 PM
Last Post: sparkt

Forum Jump:

User Panel Messages

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