Renverser une chaine⚓︎

Programmer une fonction renverser :

  • prenant en paramètre une chaine de caractères mot,

  • renvoyant une nouvelle chaine de caractères en inversant ceux de la chaine mot.

Contrainte

On s'interdit d'utiliser les fonctions reverse et reversed, ainsi que les tranches mot[::-1].

Exemples
>>> renverser('informatique')
'euqitamrofni'
>>> renverser('nsi')
'isn'
>>> renverser('')
''
###(Dés-)Active le code après la ligne # Tests (insensible à la casse)
(Ctrl+I)
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
.65038.9875.128013lS]et-dA5f1umaèg,_/R=Vin )yàqPhc[(bEs.p;r4j'9"ov+w3Ok:é 2030d0a0b0k0t070H0!0C070k0H0H0r0Q0b0t0J0Q020v030H0i0j0j0k0L0x02080R070i0^0R0u0!000k0j0J0K0!0q0a120L0z0i0a0H030p0 1113150}0J02031A1t1D0p1A0}0d0t0S0-0/0;0?0B0t0m0B071R0B0b0{030(0F070a1M0:0=0Q1Q1S1U1S0b1!1$1Y0b0L1B0b0B0-180H0J0k0u0?0#0Q1'1O0Q0g0*0a0u1g0a1Y1}1 241)271$2a0j2c02060!0A0L0R0J0R0H0t1b1d0%1{0L0L0a0C2x1t2e0u1B0p1_2J1?1^1@1Z0d2g0?1U0u292u1Y1J1L0.1(2T0t2V0u0R2Z1Y0J2C1B2H2J2:0~1~1d2#252)0L12070{0h2G2@0|2?2f2_1)2{2}0{0#311 332H2S0Q380k2~020V3c2I0}3f360?3i3k0M3n3e2@3g3t0{0f3w1E2.1t2Z2M0d1^2R3r0Q0C2*2m0$1K1B2-0a2/323D3O0%3W351N1)0X0{0%0g3w0!342^3%3s0g0{2C0u0S0a0L0H3`3D3q3:0Q0`020E3~3y3M0u0{0j0R0b453$2$410{0w0Y3w0v0!4m3-3 4f48020b0R0j3,3.3g0R0{0r4w4p250H2202001p4b0K4I0i4K4k4n4o46403(020g0R0L4C4S4q0{0C130k2E3`0a4Z4e250R0U0{2'4,3/4#024a4c1u3X4D1)424j4|3d4l4Q4n4x470{4t4v522I4R4-1)4z024B5c025e4@2`4$4'4)2C4?4y0{0T5t584s4u4P564~0?4U2C0b0i0L0u5x404r5a4k1t3Z3V3E5S0p3H1t0b3J5X2P2K0k1#5U3H1z3#5n1)2C0j0o0g0k0X0a0o0B0V0{1l1n1p1r0!512=1G331A0W2^0L0Z1%4t1a0!0d0O5%4X2R0i2V0-0B0)6k0S0t2z0%0H0^0u690!0y1{0u0b290t0L0!0/6l6n1%035R4_4b5Q3P5l3@3_3{690I0!0G0u0 2w0a0n0!1c0!0k0N0R1a1%0C6m5~0-5q0b0l2C6d6J6L4`6O3!4o1?1c0m020k0i6d0Z0F1a2G700u726_3-6L5O0p6L0I1E330B0h0!6q0?0S130t1 6B0c0k3_0C0c1$0H0c2'1J0C1r0{0s7t7v1%7y2D6F5 7F0t7H1s0k3g0B0a0k0%0L2U3(0!0B2C0g0?017s0L7u6A0a7x7z7B1r7E0u7G7I0!0^0b1$0?0A3`122(0b6F2'4U05041t0k2J7n6402660!2t0i7s2w6(0i0;0t8k133O5I6D7Q0,7S7U7e6G271d6S0,1$76780b7k631I1K7X1V1-1W2d4!252i292b0{2o080C7/0J870A0x1_1c3D3U5+2;3X6L574T3)0a3+5k5m3z3=026R3`3|4Y5k8@4f4244955D3h496N9a8V4 4h6132544m965o5z5b2:8}3M5h5j9r9n1)0H0h0{00010V0P4L9D9F5B9m9b4U4W949w9b4r0t5L4f4/4;5K8|9x3s0F3?1 0m4+9f5f0?984d5,9!0{2j9-3g9,9)9.9c6M4{2=9b420w9=9t0{0ca1400j0t2 a5970{0n9T4.a3aa25a7a99^9?acae5gagal3Maj0230ar409 9j53555C9g3s595A9Y9b9uaoaE9paK0Q5h5waHaD9`6|awab020Dah374;aZ9+0{099J9s8^900'5I9X9PaS5NaG2:0}7i6P5T2J5)037n7p0d7r7L7;0c4W0u2E0t1c2V071;027K7/7M0!b6b8ba0abc4+7W3M7Y7!3`7%237)8`7,7.7:7wbj2xbb1;7~2w810Q832|1 2987bu028b8d8f0h8h0e7z0!6j1%1U6t1%1~6E3O1h687Y6Yb91d0'6%1d1a0*0t3|7f6P6*4=a_6~511H3R2!401+1T1V1X5+3g8X2k2m8#8%0_8)8+0B8-958/3.8;3d6Ka`9L8_8{a:9*3h8 913{3}aV259@9}a;9d9|4}aSaya)9Z0Q5Fa-5JaN9z9B9H9G9E0Ka$aO0{8McFcw4rb|a/cJcw98aYcCa!9{cZ42c.c%9_9Rc=a'aN9M4XaNc`aRcw9V02b}cvc_9#909%9(c^am43cZ0ud99;c/a%dfdkaT9edd3M9 cZ5ha4dnatavdqaxand29_ducZdxc{02addC5u02dvdz4fdGdn9 09a05ka^8?1G3F5V3Sa^0%0(0*0H02.