Occurrences du minimum⚓︎
On dispose d'un tableau non vide donnees
d'entiers : les mesures d'un phénomène étudié.
Écrire une fonction telle que occurrences_mini(donnees)
renvoie un tuple composé de deux parties :
- la valeur minimale du phénomène étudié ;
- la liste des indices (rangés par ordre croissant) qui sont associés à la valeur minimale
Contraintes
On s'interdira d'utiliser min
et index
dans cet exercice.
Exemples
🐍 Console Python
>>> donnees = [+13, +49, +13, +5]
>>> occurrences_mini(donnees)
(5, [3])
🐍 Console Python
>>> donnees = [-84, +75, -84, 0, +16]
>>> occurrences_mini(donnees)
(-84, [0, 2])
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
.9875.65038.128013[(lbsS]et.ph;rd45-f'1890uma"ovw7g,_/R3=Vin
6Ok:é)y àq2Pc030l0e0f0x0L090b0V0!090x0b0b0J0y0f0L0h0y020N030b0v0w0w0x0k0U020c0z090v0@0z0M0V000x0w0h0j0V0H0e110k0X0v0e0b030G0~1012140|0h02031z1s1C0G1z0|0l0L0A0,0.0:0=0i0L0D0i091Q0i0f0`030'0a090e1L0/0;0y1P1R1T1R0f1Z1#1X0f0k1A0f0i0,170b0h0x0M0=0Y0y1%1N0y0p0)0e0M1f0e1X1|1~231(261#290w2b02060V0Z0k0z0h0z0b0L1a1c0$1`0k0k0e0!2w1s2d0M1A0G1^2I1=1@1?1Y0l2f0=1T0M282t1X1I1K0-1'2S0L2U0M0z2Y1X0h2B1A2G2I2/0}1}1c2!242(0k11090`0V0r2F2?0{2=2e2^1(2`2|2~0Y311~332G2R0y380x2}020V0I3c2H0|3f360=3i3k0V0m3o3e2?3g3u2~0n3y3q3A3s3h0z2{3j2~0O3F342@1M373K393l0C3P3r3S3t3U3M3l0s3Y3H3!3J3L3v0t3)353+3C020r0u3:3R2#3,3V0r301t321D2-1s2Y2L0l1@2Q3I0!2)2l0#1J1A2,0e2.42413d034c0$4k3;3|0Q0`0$0p3y0V3Q3B0p0`0z0!0!0v2A280!1q0F0w2%0L3y4A3I0_02084Q3Z3|0M4v1b2U1q4W3*3|4T0T0R3F0V4.4z4X2_0`4N0M4P4m2H4:4(240z0`0J4y4R3=4!0M4$1r4`4r3{244T074'4s244N0`3_59534)0`0d4-4/5m4=022%1I4K582/4|5g1(4 0251595A5b1(5d5p590N4/5H3g4u020p3K524;370`4_5z5s5C0B5Y0M5V4}370a0`0k1~0D0e5f5I0=4T4V5l5W3t5,022i5=3g5^603I4Z020l4#0e4%5`5*5@0`0T4+5q5O4.5#3t0`0A3j0e4H5)5B0=5D5F5!5{3h5557633+5d6B4Y5Y6E5c5o6h6i6k0y5R0L4x5G6M656n1#6q6R6x6u6v325P644?4O6H5J0`4,5M6i6.6$545u0M5w6a2;6Y0`0g6)6l020x0h0h280l6}0y626b6s6y5u754*6K5O6M5R0e1T6Q6w6c7a6U6p0k6r5?0y5D00090f0j7r3B6'4^7c6+7e6/6S7B5Z6#6M6u7z6%027o6W2/5N6/7f6x655v0L5x7N3+7M6X7m6D787s7X7D025L7S7V7m5R2B0f4H5(7'79776_7m654@7J4n6x4T0E7#6F6=6@5y42846e3P0G4p4j438i0G461s0f488n2O2J0x1!8k461y5a3g2B0w0F0p0x0Q0e0F0i0I0`1k1m1o1q0V6,2;1F330i0r0V0L0l0=0A0e0k2u1b0o5T0M2D0L68091:020K8#8%1c8)8+8-1#030x3g0i0e0x0$0k2T4u0V0i2B0p0=018!8$8,0M8(1b8_567i1:0V0@0f1#0=0Z8#112'0f0V940`04051s0x2I8U331z0P1c2s4H5.2v0V0S0!0k0L2B0V0v2@4d0V0x8!0!9T1c0b0f0U1#0V0h180+8^2w2U091D332Y8~1U1,1V2c7m2h282a0`2n0c9P0^9v0Z0U1^1b4Q4i5a2:428h8y3I5R4w872_4C024E4G4I8*4L817-5_7~7965679j6^8c7(6e8Q327T6j7W7Ial5C50aM6~aA6A7*610`5eaT3I5i025kax7s4T7/aH7;ay5'8aaP7taO7{a%aV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