Category : list

I’m trying to understand how this code works, we have: people = [‘Dr. Christopher Brooks’, ‘Dr. Kevyn Collins-Thompson’, ‘Dr. VG Vinod Vydiswaran’, ‘Dr. Daniel Romero’] def split_title_and_name(person): return person.split()[0] + ‘ ‘ + person.split()[-1] So we are given a list, and this method is supposed to basically delete everything in the middle between "Dr." and ..

Read more

I have 2 Lists of dictionaries, example below: list one = [ {‘day’: ‘2021-09-05 00:00:00+02:00’, ‘airtime_total_for_day’: ‘650.00’, ‘data_total_for_day’: ‘0’}, {‘day’: ‘2021-09-16 00:00:00+02:00’, ‘airtime_total_for_day’: ‘124.20’, ‘data_total_for_day’: ‘20.00’}, ] list_two = [ {‘day’: ‘2021-09-10 00:00:00+02:00’, ‘data_bundle_total_for_day’: ‘100.00’}, {‘day’: ‘2021-09-16 00:00:00+02:00’, ‘data_bundle_total_for_day’: ‘50.00’}, {‘day’: ‘2021-09-18 00:00:00+02:00’, ‘data_bundle_total_for_day’: ‘45.00’}, ] I would like to merge the two lists together ..

Read more

I need to get this output in my python code: but I am getting index out of range error like this: here’s my code: marks = [[‘john’,80, 90, 76, 82],[‘katy’, 50, 55, 70, 65],[‘sydney’,80, 72, 88, 90]] marks_c = {} for i in range(len(marks)): name = marks[i][0] l = [] for j in range(2,len(marks[i])): print(marks[j][i]) ..

Read more

I was trying to make programm that finds determinant of any given matrix and in the next bit of programm I was trying to find all minors def deff(m,y=[]): #Here must be other parts of the programm #But I don’t think they are affecting this bit x=0 for i in range(len(m)): #m is the matrix(2d ..

Read more