{"id":1675,"date":"2021-11-12T07:14:58","date_gmt":"2021-11-12T06:14:58","guid":{"rendered":"http:\/\/labodemaths.fr\/WordPress3\/?p=1675"},"modified":"2021-11-18T17:15:26","modified_gmt":"2021-11-18T16:15:26","slug":"nsi2021-2022lecon-n4-les-tuples","status":"publish","type":"post","link":"https:\/\/labodemaths.fr\/WordPress3\/nsi2021-2022lecon-n4-les-tuples\/","title":{"rendered":"NSI,2021-2022,Le\u00e7on N\u00b04, Les tuples"},"content":{"rendered":"\n<div class=\"wp-block-file\"><a href=\"https:\/\/labodemaths.fr\/WordPress3\/wp-content\/uploads\/2021\/11\/NSI-_lec\u0327on_4_les_tuples.pdf\">NSI-_lec\u0327on_4_les_tuples<\/a><a href=\"https:\/\/labodemaths.fr\/WordPress3\/wp-content\/uploads\/2021\/11\/NSI-_lec\u0327on_4_les_tuples.pdf\" class=\"wp-block-file__button\" download>T\u00e9l\u00e9charger<\/a><\/div>\n\n\n\n<p class=\"has-text-color has-background has-very-light-gray-color has-vivid-red-background-color\">Proposition correction<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def temps_secondes(temp):\n    '''\n    >>>temps_secondes((1,10,5))\n    4205\n    '''\n    heures=temp[0]\n    minutes=temp[1]\n    secondes=temp[2]\n    return heures*3600+minutes*60+secondes\n\ndef temps_h_mn_s(temp):\n    '''\n    >>>temps_h_mn_s(4205)\n    (1,10,5)\n    '''\n    heures=temp\/\/3600\n    minutes=(temp%3600)\/\/60\n    secondes=(temp%3600)%60\n    return (heures,minutes,secondes)\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):\n    retour=()\n    for coureur in var:\n        nom_coureur=coureur[0]\n        temps_coureur=coureur[1]\n        temps_coureur_s=temps_secondes(temps_coureur)\n        # j'ajoute (nom_coureur,temp_coureur_s)\n        # \u00e0 mon retour\n        retour+=((nom_coureur,temps_coureur_s),)\n    return retour\n\ndef liste_temps(var):\n    tuple_retour=()\n    for candidat in var:\n        temps=candidat[1]\n        tuple_retour+=(temps_s,)\n    return tuple_retour\n\ndef val_min(var):\n    val_min=min(var)\n    position_val_min=var.index(val_min)\n    return val_min,position_val_min\n\ndef gagnant(var):\n    temps_donnees_en_s=temps_en_s(var)\n    liste_temps_en_s=liste_temps(temps_donnees_en_s)\n    position_gagnant=val_min(liste_temps_en_s)[1]\n    nom_gagnant=var[position_gagnant][0]\n    return nom_gagnant\n    \n    <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Proposition correction<\/p>\n","protected":false},"author":2,"featured_media":1678,"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\/1675"}],"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=1675"}],"version-history":[{"count":4,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/posts\/1675\/revisions"}],"predecessor-version":[{"id":1693,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/posts\/1675\/revisions\/1693"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/media\/1678"}],"wp:attachment":[{"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/media?parent=1675"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/categories?post=1675"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/tags?post=1675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}