{"id":1479,"date":"2022-04-25T09:51:00","date_gmt":"2022-04-25T07:51:00","guid":{"rendered":"http:\/\/labodemaths.fr\/WordPress3\/?p=1479"},"modified":"2022-04-26T09:33:32","modified_gmt":"2022-04-26T07:33:32","slug":"nsi-tp-bac1","status":"publish","type":"post","link":"https:\/\/labodemaths.fr\/WordPress3\/nsi-tp-bac1\/","title":{"rendered":"NSI : TP Bac, entrainement 1"},"content":{"rendered":"\n<h4>Exercice 1<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Programmer la fonction multiplication, prenant en parame\u0300tres deux nombres entiers n1 et n2, et qui renvoie le produit de ces deux nombres.\nLes seules ope\u0301rations autorise\u0301es sont l\u2019addition et la soustraction.\nExemples :\n&gt;&gt;&gt; multiplication(3,5)\n15\n&gt;&gt;&gt; multiplication(-4,-8)\n32\n&gt;&gt;&gt; multiplication(-2,6)\n-12\n&gt;&gt;&gt; multiplication(-2,0)\n0<\/code><\/pre>\n\n\n\n<h4>Exercice 2<\/h4>\n\n\n\n<p>Compl\u00e9ter la fonction.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def dichotomie(tab, x):\n    \"\"\"\n    tab : tableau d\u2019entiers tri\u00e9 dans l\u2019ordre croissant\n    x : nombre entier\n    La fonction renvoie True si tab contient x et False sinon\n    \"\"\"\n\n    debut = 0 \n    fin = len(tab) - 1\n    while debut &lt;= fin:\n        m = ...\n        if x == tab&#91;m]:\n            return ...\n        if x &gt; tab&#91;m]:\n            debut = m + 1\n        else:\n             fin = ...\t\t\t\n    return ...\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Exercice 1 Exercice 2 Compl\u00e9ter la fonction.<\/p>\n","protected":false},"author":2,"featured_media":1233,"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\/1479"}],"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=1479"}],"version-history":[{"count":4,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/posts\/1479\/revisions"}],"predecessor-version":[{"id":1940,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/posts\/1479\/revisions\/1940"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/media\/1233"}],"wp:attachment":[{"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/media?parent=1479"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/categories?post=1479"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/tags?post=1479"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}