mercredi 30 juin 2021

How can I add two lists having different dimensions in python?

I have a sorted list of points of intersections (x, y) as shown in the list below, named as coordinates

coordinates =[(66, 66), (132, 66), (199, 66), (266, 66), (333, 66), (399, 66), (466, 66), (533, 66)]

I have also an array with errors defined as Error = [10, 32, 12, 43, 56, 23, 21,11]

Is it possible to add every element from the Error array such that the output for the coordinates should be as follows

new_coordinates = [(66+10, 66+32), (132+32, 66+32), (199+12, 66+12), ..., (533+11, 66+11)]

Thanks for your extended help




Aucun commentaire:

Enregistrer un commentaire