Est trié ?
Programmer la fonction est_trie
qui prend en paramètre un tableau de valeurs numériques et qui détermine si ce tableau est trié dans l'ordre croissant. La fonction renvoie un booléen True
ou False
.
Contrainte
On interdit d'utiliser les fonctions de tri natives sort
et sorted
.
Exemples
>>> est_trie([0, 5, 8, 8, 9])
True
>>> est_trie([8, 12, 4])
False
>>> est_trie([-1, 4])
True
>>> est_trie([5])
True
>>> est_trie([])
True
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
.65038.9875.128013lS]et-d5f1umaèg,_F/R=Vin
)yàqPhcLN[(bùsx.p;r4j'"ovTw3Ok:é 2I030d0a0b0j0t070J0$0C070j0J0J0r0S0b0t0M0S020v030J0h0i0i0j0O0x02080T070h0{0T0u0$000j0i0M0N0$0q0a150O0z0h0a0J030p12141618100M02031D1w1G0p1D100d0t0U0:0=0@0_0B0t0l0B071U0B0b0~030+0H070a1P0?0^0S1T1V1X1V0b1%1(1#0b0O1E0b0B0:1b0J0M0j0u0_0%0S1*1R0S0f0-0a0u1j0a1#2022271,2a1(2d0i2f02060$0A0O0T0M0T0J0t1e1g0)1~0O0O0a0C2A1w2h0u1E0p1|2M1_1{1`1$0d2j0_1X0u2c2x1#1M1O0;1+2W0t2Y0u0T2$1#0M2F1E2K2M2?11211g2'282,0O15070~0g2J2`0 2_2i2|1,2~300~0%3422362K2V0S3b0j31020X3f2L103i390_3l3n0P3q3h2`3j3w0~0e3z1H2;1w2$2P0d1{2U3u0S0C2-2p0(1N1E2:0a2=353G3R0)3Z381Q1,0Z0~0)0f3z0$372{3)3v0f0~1u0b0n1_0t0a3G3t3?0S0}020G403B3P0u0~1?0a0j0h473(2(430~0w0!3z0v0$4p3:414i3+020f0T0O3/3;3C0~0t4z4s280T0W4C0u4E48420u0H0~0O220l3 1x3!4F1,44464V3g4A3P0i0t324g3=4i440m4L4h2}4P022m4+3j4Z4_494b0j1'4d4f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a 3Y7a1f7g0#aJa20$b87x8=bc7Bbf7U0S6n0~bj6a3!bm3%0mac2,1gbKbabM1/bO7D3PbS02670.bV4$bX3YaZ9Z1D08ad070R0T0H0Q0*8i0baD74b17g0U8j0abZb}a-a/a;3%a?a^0Ta`a|a~b?5j2F0u0U7j1)bG3m7e7tcg1)b(7A1;bP7'b-bU7@72b^362$bbb)cDb+422l2c2e0~2r080C9?0M7g0A0x1|1f3G3X6M2@3!726ebR3,0a5h6kc/0u3^023`3|aE7*7(7M4Wbg3k7,757%4`4k6(356c6lb,4Q6h605X4N4?a?c 4{d75Y9.dm5sc 5w5y7/bQ5:di4i5R025T5V0rdz5,735o52dw7'5(dt5-7Yd3dB5EdQbQ7Q7SdLd8025OdUcF0~4w4yd$4B5xdG1,4H4Jd-3v7F4Sb;547OdndY4'4)7Rdr027Xc@7Z4?7$d|5r7)do4Nd57.d2dx4k7?5?bB2Mc*3J3V6L0qce8Y6:0$6=6@9 6`0:6}6 czdI7-527_797b9?7da69}7ka09Ia3aka67vbL427zbd7Cc^d?7Hd^cQ5Me9e74idWe0e235dddj7#2ce0d14$7ZecdKeedMegcIbn7{7}7g8082bp852C888a1(aLc20d97czcNcCbee$4=0~dleae%e?d_dR0~0Lfte0cn6)7_cqcs3~eBcHcocKa#0)0+0-0J02.
# Tests
(insensible à la casse)(Ctrl+I)