{"id":2002,"date":"2025-09-29T08:09:00","date_gmt":"2025-09-29T06:09:00","guid":{"rendered":"https:\/\/labodemaths.fr\/WordPress3\/?p=2002"},"modified":"2025-10-06T11:42:48","modified_gmt":"2025-10-06T09:42:48","slug":"nsi2022-2023-lecon-3-les-tuples-en-python","status":"publish","type":"post","link":"https:\/\/labodemaths.fr\/WordPress3\/nsi2022-2023-lecon-3-les-tuples-en-python\/","title":{"rendered":"nSi,2025-2026,  les tuples en python"},"content":{"rendered":"\n<div class=\"wp-block-file\"><a href=\"https:\/\/labodemaths.fr\/WordPress3\/wp-content\/uploads\/2022\/09\/NSI-_lec\u0327on_3_les_tuples.pdf\">NSI-_lec\u0327on_les_tuples<\/a><a href=\"https:\/\/labodemaths.fr\/WordPress3\/wp-content\/uploads\/2022\/09\/NSI-_lec\u0327on_3_les_tuples.pdf\" class=\"wp-block-file__button\" download>T\u00e9l\u00e9charger<\/a><\/div>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def temps_secondes(temps):\n    '''\n    >>>temps_secondes((1,10,5))\n    4205\n    '''\n    return temps&#91;0]*3600+temps&#91;1]*60+temps&#91;2]    \n  \n\ndef temps_h_mn_s(temps):\n    '''\n    >>>temps_h_mn_s(4205)\n    (1,10,5)\n    '''\n    h=temps\/\/3600\n    mn=(temps-h*3600)\/\/60\n    s=temps-h*3600-mn*60\n    return (h,mn,s)\n    \ndonnees=(\n # ( nom du candidat, temps sous la forme (h,mn,s))\n (\"Paul\",(2,3,45)),\n (\"Sandrine\",(1,10,5)),\n (\"Jacques\",(2,0,15))\n )\n\ndef temps_en_s(var):\r\n    '''\r\n    transforme les temps des coureurs en temps en secondes\r\n    : return : tuple\r\n    >>>temps_en_s(donnees)\r\n    (('Paul', 7425), ('Sandrine', 4205), ('Jacques', 7215))\r\n    '''\r\n    retour=()\r\n    for candidat in var:\r\n        nom=candidat&#91;0]\r\n        temps=temps_secondes(candidat&#91;1])\r\n        retour+=((nom,temps),)\r\n    return retour\r\n   \n    \n        \ndef liste_temps(var):\n    ''' retourne les temps sous la forme d'un tuple:\n    >>>course=(('Paul', 7425), ('Sandrine', 7102), ('Jacques', 7215))\n    >>>liste_temps(course)\n    (7425,7102,7215)\n    '''\n   \n   \ndef val_min(A):\n    '''\n    retourne la valeur minimale et l'indice correspondant\n    >>>A=(2,3,6,2,1,6)\n    >>>val_min(A)\n    (1,4)\n    '''\n    pass\n    \ndef gagnant(var):\n    pass\n    \n\n\n\n\n    \n    \n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":2004,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[57],"tags":[],"_links":{"self":[{"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/posts\/2002"}],"collection":[{"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/comments?post=2002"}],"version-history":[{"count":18,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/posts\/2002\/revisions"}],"predecessor-version":[{"id":2927,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/posts\/2002\/revisions\/2927"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/media\/2004"}],"wp:attachment":[{"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/media?parent=2002"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/categories?post=2002"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/tags?post=2002"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}