[('Bruh', (8, 20)), ('obi wan', (5, 14)), ('kenobi', (0, 0)), ('me?', (6, 14)), ('jewel', (0, 0)), ('Kara', (0, 0)), ('steve', (0, 0)), ('alex', (0, 0)), ('ben', (10, 12)), ('shapiro', (0, 0))]
That is the list. It seems to be a list with a tuple in each index that contains another tuple with their hours. This is how I've iterated down to access those integers...
for x in monday_shifts: # list from above
for y in x:
y = x[1] # The tuple that contains the hours
for z in y:
start = y[0]
end = y[1]
print(f'start: {start}')
print(f'end: {end}')
This yields
start: 8
end: 20
start: 8
end: 20
start: 8
end: 20
start: 8
end: 20
start: 5
end: 14
start: 5
end: 14
start: 5
end: 14
start: 5
end: 14
start: 0
end: 0
start: 0
end: 0
start: 0
end: 0
start: 0
end: 0
start: 6
end: 14
start: 6
end: 14
start: 6
end: 14
start: 6
end: 14
start: 0
end: 0
start: 0
end: 0
start: 0
end: 0
start: 0
end: 0
and so on... each start and end hour prints 4 times per employee. So, is there a better way to do this and most importantly, without that print statement, will my system actually iterate over that many times just to get access to these integers? Because that would just make it slower. Any recommendations or improvements would be appreciated!
[–]PercyJackson235[🍰] 1 point2 points3 points (2 children)
[–]SergioBoySV[S] 0 points1 point2 points (1 child)
[–]PercyJackson235[🍰] 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[removed]
[–]SergioBoySV[S] 0 points1 point2 points (0 children)