Double du précédent dans un tableau

Écrire une fonction nombres_puis_double qui prend en paramètre un tableau de nombres entiers valeurs. Cette fonction renvoie la liste (éventuellement vide) des couples d'entiers (a, b) tels que a et b soient deux termes successifs de valeurs, et la valeur de b soit le double de celle de a.

Exemples
>>> nombres_puis_double([1, 4, 2, 5])
[]
>>> nombres_puis_double([1, 3, 6, 7])
[(3, 6)]
>>> nombres_puis_double([7, 1, 2, 5, 3, 6])
[(1, 2), (3, 6)]
>>> nombres_puis_double([5, 1, 2, 4, 8, -5, -10, 7])
[(1, 2), (2, 4), (4, 8), (-5, -10)]
def nombres_puis_double(valeurs):
...
# Tests
assert nombres_puis_double([1, 4, 2, 5]) == []
assert nombres_puis_double([1, 3, 6, 7]) == [(3, 6)]
assert nombres_puis_double([7, 1, 2, 5, 3, 6]) == [(1, 2), (3, 6)]
assert nombres_puis_double([5, 1, 2, 4, 8, -5, -10, 7]) == [
(1, 2),
(2, 4),
(4, 8),
(-5, -10),
]
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
###(Dés-)Active le code après la ligne # Tests (insensible à la casse)
(Ctrl+I)
Entrer ou sortir du mode "deux colonnes"
(Alt+: ; Ctrl pour inverser les colonnes)
Entrer ou sortir du mode "plein écran"
(Esc)
rounded
>>> 
 
x
x
Tronquer ou non le feedback dans les terminaux (sortie standard & stacktrace / relancer le code pour appliquer)
Si activé, le texte copié dans le terminal est joint sur une seule ligne avant d'être copié dans le presse-papier
Évaluations restantes : 5/5
.128013d:ro*i1t,-wua_l 2P5[4/emkg6.(cfpyvhnb])=3sS050b0x0i0n0g0p0Q0q0E0p0n0Q0Q0O010i0g0G010406050Q0m0y0y0n0d0H040R0e0p0m0,0e0K050w0?0^0`0|0;0G04051c151f0w1c0;0b0g0I0!0$0(0*0J0g0A0J0p1t0J0i0/050V0L0p0x1o0%0)011s1u1w1u0i1C1E1A0i0d1d0i0J0!0 0Q0G0n0K0*0r011G1q010F0X0x0K0n0y0x1A1Z1#1*1I1-1E1:1=0/0a0q0s0d0e0G0e0Q0g120K0q0T1X0d0d0x0E2a151^0K1d0w1V2n1S1U1T1B0b1`0*1w0K1/271A1l1n0#1H2x0g2z0K0e2D1A0G2g1d2l2n2R0=1!2b2F1+2K0d0_0p0/0h2k2V0:2U1_2X1I2Z2#0/0r2)1#2+2l2w012:0n2$040P2@2m0;2`2.0*2}2 0v322_2V2{380/0t3b343d362|0e2!2~0/0B3b1g2P152D2q0b1U2v3l0E2L1?1d3w1e3u2T162*053C0T2Q3k1p1I0z0/0T0F3s353R0*0l0/0q3X3Q2G2|0F0/2K0y0L2g0Q0o0G0m0g3=0b0e0m1D0x3(2-3Z010.040D402W420K0/0I2~0x0m0d0Q472{440N0c3i0q4o3%3Y3*4a043;0m0p0V0i3b4q3)1+0e0/0O4A2,483*440u0M4n4p4I2{3T040F3n4H4r2Y0/0g4W4C1I0e3#042I4#414s0L0/0d1#0A3 3K2^4Q3l44464^2m4`420y0g2%4i4{0/0j4,4J2Y4/041}55424|5f4s4b4d4f4h4~3P4-1+4k4l4O4p4P4X3S4Z3W5o4B5q2/5k1E5m5i5r0/0u5I5E4*5M0*444N5B503*4E040O4G5T5x375F4e4g5P435K5*4t4!5!4$0*5W0k592{52545o5U5J045S2R5C5a4%0/0f5^3l5`042?5|5#5+044m5o065v6j5w5;2|4:0x0?4x0n4z6c6m5W0C5-0/0n0G0G1/0b5*4|4}2T6d4t4c5G5)6u5D5Q5,6O635$5O5:6P015?675153042(6S4j0/0M586W6T6n046L5(5n6I6m4L6y6V6^6X5R0N0N5u624R6o0i4f146.3e6o6q4y3i153N0x2n2O7h3v1m3x2q2t2o0n3~2n3w0;0w0T0V0X0Q04.