Posts by Leonardo Barcelos • 1 point
1 post
-
-4
votes2
answers71
viewsQ: Python rounding list
a = [1.2,2.3,3.4] b = [4.1,5.2,6.3] x = 3.4 y = a.index(x) print (y) y1 = b[y] print (y1) As I would in the code if x were 3. and I wanted to show the nearest value. in the case if x = 3, y would…