Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List calculations
#2
Something like this?
alist = [[f'{a}{b}' for b in range(4)] for a in 'ABCDE']
for x in alist:
    print(x)

blist = []
count = len(alist[0])
for x in range(count):
    blist.append([alist[y][(x+y)%count] for y in range(len(alist))])

for x in blist:
    print(x)
What I am calling alist would be [Maths, English, History, Acade, Sport]
Reply


Messages In This Thread
List calculations - by rturus - Mar-23-2021, 03:49 PM
RE: List calculations - by deanhystad - Mar-23-2021, 04:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Parameterized math calculations? babaliaris 7 18,575 Jun-01-2022, 10:19 AM
Last Post: Gribouillis
  Python, how to manage multiple data in list or dictionary with calculations and FIFO Mikeardy 8 4,525 Dec-31-2021, 07:47 AM
Last Post: Mikeardy
Photo Filtering data and precision during calculations Scientifix 0 2,345 Mar-30-2021, 01:00 PM
Last Post: Scientifix
  Automation in calculations interdisciplinary 5 3,927 Dec-10-2020, 11:22 PM
Last Post: deanhystad
  Latitude&Longitude Calculations gdimit 3 4,705 Jan-30-2018, 07:47 AM
Last Post: buran

Forum Jump:

User Panel Messages

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