As the topic suggests I am attempting to take integers (in tuples) from one list and to to add them to another using the pop function
Here’s what I have so far and am stuck doing so.
loga = [(912, "Message A1") , (1000, "Message A2") , (988, "Message A3") , (1012, "Message A4") , (1002, "Message A5")]
logb = [(926, "Message B1") , (1008, "Message B2") , (996, "Message B3") , (1019, "Message B4") , (1100, "Message B5")]
logc = [(1056,"Message C1") , (1033, "Message C2") , (999, "Message C3") , (1054, "Message C4") , (1086, "Message C5")]
logs = [loga, logb, logc]
def find_lowest_i(logs):
for i in range(len(lst)):
log = lst(i)
if len(log) > t = log[0][0]
if i==0 or t < lowest_t
lowest_i = i
lowest_t = t
return i
That should do the trick for you, it works by iterating over
loga,logb,logcthrough thelogslist, appending the numbers to thefinallist, then using a list comprehension with themin()function to get the lowest number.