I have a list containing ID's of students:
ID = [1,2,3]
and i have a table containing student names and their hobby:
student = [['Jack','Fishing'],['Alice','Reading'],['Mun','Football']]
I want to concatenate the ID to the first position of each sublist within the student list where i obtain:
[[1,'Jack','Fishing'],[2,'Alice','Reading'],[3,'Mun','Football']]
I tried:
for i in range(len(student)):
student = ID[i] + student[i]
but I'm getting an error saying unsupported operand type.
student = [ID[i]] + student[i]should work.