Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List joining
#3
(Dec-05-2022, 08:48 PM)deanhystad Wrote: Looks like you want the task list to be: a, b, c, a, b, c, a, b, c, a
If there was just some kind of ITERATOR TOOL that would CYCLE through a list for as long as needed?

You can also use indexing and the modulo operator, but the above hint is better.

If you don't want to search any more after those hints, let me know and I'll give it to you straight

Evening,

Found ITERTOOLS and CYCLE which are great, got it to cycle through endlessly. When I try to use that to combine the lists I'm back to where I've been with for loops, random. choice and such. The result is a partial list, or just a re-labled list..

any more hints?
Reply


Messages In This Thread
List joining - by deatz - Dec-05-2022, 07:50 PM
RE: List joining - by deanhystad - Dec-05-2022, 08:48 PM
RE: List joining - by deatz - Dec-06-2022, 12:54 AM
RE: List joining - by deanhystad - Dec-06-2022, 10:07 PM
RE: List joining - by deatz - Dec-07-2022, 05:28 PM
RE: List joining - by deanhystad - Dec-07-2022, 07:39 PM
RE: List joining - by deatz - Dec-08-2022, 12:27 AM
RE: List joining - by deanhystad - Dec-08-2022, 01:42 AM
RE: List joining - by deatz - Dec-15-2022, 01:00 PM
RE: List joining - by deanhystad - Dec-15-2022, 04:16 PM
RE: List joining - by deatz - Dec-15-2022, 04:47 PM
RE: List joining - by deatz - Dec-20-2022, 04:18 PM
RE: List joining - by DeaD_EyE - Dec-15-2022, 04:49 PM
RE: List joining - by deanhystad - Dec-20-2022, 11:40 PM
RE: List joining - by deatz - Dec-21-2022, 03:34 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Using a function: splitting, joining, and slicing a string Drone4four 2 5,807 Dec-27-2018, 07:52 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

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