I have a list like:
A=[(0, 16), (1, 11), (2, 4), (3, 14), (4, 8), (5, 15), (6, 13), (7, 2), (8, 20), (9, 17), (10, 5), (11, 12), (12, 6), (13, 7), (14, 0), (15, 1), (16, 19), (17, 18), (18, 10), (19, 9), (20, 3)]
This is a route of a car.For example this car leaves from 0 to 16(0,16) then it goes from 16 to 19(16,19) than it goes from 19 to 9 etc. For big datasets it is hard to follow this route. I try to write loops but couldn't succeed.I have to convert this A list to another list like
B=[0,16,19,9,17,18,10,5,15,1,11,12,6,13,7,2,4,8,20,3,14,0]