{"id":1312,"date":"2020-09-20T21:42:12","date_gmt":"2020-09-20T19:42:12","guid":{"rendered":"http:\/\/labodemaths.fr\/WordPress3\/?p=1312"},"modified":"2020-09-21T17:44:21","modified_gmt":"2020-09-21T15:44:21","slug":"nsi-tp2","status":"publish","type":"post","link":"https:\/\/labodemaths.fr\/WordPress3\/nsi-tp2\/","title":{"rendered":"NSI, TP2"},"content":{"rendered":"\n<div class=\"wp-block-file\"><a href=\"https:\/\/labodemaths.fr\/WordPress3\/wp-content\/uploads\/2020\/09\/NSI1ere_TP2-1.pdf\">NSI1ere_TP2-1<\/a><a href=\"https:\/\/labodemaths.fr\/WordPress3\/wp-content\/uploads\/2020\/09\/NSI1ere_TP2-1.pdf\" class=\"wp-block-file__button\" download>T\u00e9l\u00e9charger<\/a><\/div>\n\n\n\n<p class=\"has-text-color has-background has-vivid-red-color has-pale-cyan-blue-background-color\">correction activit\u00e9 1 \u00e0 3<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def inverse(message):\n    ''' inverse une cha\u00eene de caract\u00e8res\n    message : type str\n    return : retourne le message invers\u00e9 (str )\n    >>> inverse(\"azerty\")\n    \"ytreza\"\n    >>> inverse(\"non\")\n    \"non\"\n    >>> inverse(1245)\n    5421\n    '''\n    message1=str(message)\n    retour=\"\"\n    for i in range(len(message1)-1,-1,-1): #on parcourt les indices \u00e0 l'envers\n       retour=retour+message1[i]\n    if type(message)==str :\n        return retour\n    return int(retour)\n    \n    \ndef palindrome(message):\n ''' indique si le message est un palindrome (se lit de droite \u00e0 gauche ou\nde gauche \u00e0 droite )\n message : type str ou int\n return : True si message est un palindromme, False sinon.\n\n >>> palindrome(\"azerty\")\n False\n >>> palindrome(\"non\")\n True\n >>> palindrome(12)\n False\n >>> palindrome(1221)\n True\n '''\n return inverse(message)==message\n \n    <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>correction activit\u00e9 1 \u00e0 3<\/p>\n","protected":false},"author":2,"featured_media":815,"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\/1312"}],"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=1312"}],"version-history":[{"count":3,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/posts\/1312\/revisions"}],"predecessor-version":[{"id":1321,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/posts\/1312\/revisions\/1321"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/media\/815"}],"wp:attachment":[{"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/media?parent=1312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/categories?post=1312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/tags?post=1312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}