{"id":1980,"date":"2023-11-22T22:52:36","date_gmt":"2023-11-22T21:52:36","guid":{"rendered":"http:\/\/localhost:8080\/maxblog\/?p=1980"},"modified":"2023-11-22T22:53:45","modified_gmt":"2023-11-22T21:53:45","slug":"la-notion-de-fonction","status":"publish","type":"post","link":"https:\/\/www.maxdecours.com\/maxblog\/la-notion-de-fonction\/","title":{"rendered":"La notion de fonction"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"1980\" class=\"elementor elementor-1980\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-7d71a4a elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"7d71a4a\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-389cd7d\" data-id=\"389cd7d\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-a8169f1 elementor-widget elementor-widget-spacer\" data-id=\"a8169f1\" data-element_type=\"widget\" data-widget_type=\"spacer.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-spacer\">\n\t\t\t<div class=\"elementor-spacer-inner\"><\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-7643655 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"7643655\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-f297427\" data-id=\"f297427\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-361d80f elementor-widget elementor-widget-heading\" data-id=\"361d80f\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-heading-title elementor-size-xl\">La notion de fonction<\/div>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-de06178 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"de06178\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-c8b729b\" data-id=\"c8b729b\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-1f07f28\" data-id=\"1f07f28\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-b7c611b elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"b7c611b\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-9a7e2c2\" data-id=\"9a7e2c2\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-fffe349 nc-justify-text elementor-widget elementor-widget-text-editor\" data-id=\"fffe349\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.maxdecours.com\/maxblog\/la-notion-de-fonction\/#Introduction\" >Introduction<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.maxdecours.com\/maxblog\/la-notion-de-fonction\/#Cours\" >Cours<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.maxdecours.com\/maxblog\/la-notion-de-fonction\/#1_Fonctions_a_un_ou_plusieurs_arguments\" >1. Fonctions \u00e0 un ou plusieurs arguments<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.maxdecours.com\/maxblog\/la-notion-de-fonction\/#2_Fonction_renvoyant_un_nombre_aleatoire\" >2. Fonction renvoyant un nombre al\u00e9atoire<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.maxdecours.com\/maxblog\/la-notion-de-fonction\/#3_Serie_statistique_obtenue_par_la_repetition_de_lappel_dune_telle_fonction\" >3. S\u00e9rie statistique obtenue par la r\u00e9p\u00e9tition de l\u2019appel d\u2019une telle fonction<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.maxdecours.com\/maxblog\/la-notion-de-fonction\/#Methodes\" >M\u00e9thodes<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.maxdecours.com\/maxblog\/la-notion-de-fonction\/#1_Ecrire_des_fonctions_simples_et_appeler_une_fonction\" >1. \u00c9crire des fonctions simples et appeler une fonction<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.maxdecours.com\/maxblog\/la-notion-de-fonction\/#2_Lire_comprendre_modifier_et_completer_des_fonctions_plus_complexes\" >2. Lire, comprendre, modifier, et compl\u00e9ter des fonctions plus complexes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.maxdecours.com\/maxblog\/la-notion-de-fonction\/#3_Lire_et_comprendre_une_fonction_renvoyant_une_moyenne_un_ecart_type\" >3. Lire et comprendre une fonction renvoyant une moyenne, un \u00e9cart type<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.maxdecours.com\/maxblog\/la-notion-de-fonction\/#4_Ecrire_des_fonctions_renvoyant_le_resultat_numerique_dune_experience_aleatoire_dune_repetition_dexperiences_aleatoires_independantes\" >4. \u00c9crire des fonctions renvoyant le r\u00e9sultat num\u00e9rique d&rsquo;une exp\u00e9rience al\u00e9atoire, d\u2019une r\u00e9p\u00e9tition d&rsquo;exp\u00e9riences al\u00e9atoires ind\u00e9pendantes<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"Introduction\"><\/span>Introduction<span class=\"ez-toc-section-end\"><\/span><\/h1><p class=\"MsoNormal\">\u00a0<\/p><p class=\"MsoNormal\">En programmation, une fonction est un ensemble d&rsquo;instructions qui accomplissent une t\u00e2che sp\u00e9cifique. Les fonctions permettent d&rsquo;organiser le code en segments r\u00e9utilisables, facilitant ainsi la maintenance, la lisibilit\u00e9 et la modularit\u00e9. Que ce soit pour des calculs math\u00e9matiques simples ou pour des simulations statistiques plus complexes, les fonctions sont essentielles \u00e0 la programmation efficace.<\/p><p class=\"MsoNormal\">\u00a0<\/p><h1><span class=\"ez-toc-section\" id=\"Cours\"><\/span>Cours<span class=\"ez-toc-section-end\"><\/span><\/h1><p class=\"MsoNormal\">\u00a0<\/p><h2><span class=\"ez-toc-section\" id=\"1_Fonctions_a_un_ou_plusieurs_arguments\"><\/span>1. Fonctions \u00e0 un ou plusieurs arguments<span class=\"ez-toc-section-end\"><\/span><\/h2><p class=\"MsoNormal\">\u00a0<\/p><p class=\"MsoNormal\"><b>a. Fonctions \u00e0 un argument :<\/b><\/p><p class=\"MsoNormal\">Une fonction peut avoir un seul argument, qui est une valeur ou une variable pass\u00e9e \u00e0 la fonction.<\/p><p class=\"MsoNormal\">\u00a0<\/p><p class=\"MsoNormal\" style=\"line-height: 125%; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;\"><b><span lang=\"EN-US\" style=\"font-size: 10.5pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: green; mso-ansi-language: EN-US; mso-fareast-language: FR;\">def<\/span><\/b><span lang=\"EN-US\" style=\"font-size: 10.5pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: FR;\"> <span style=\"color: blue;\">carre<\/span>(x):<\/span><\/p><p class=\"MsoNormal\" style=\"line-height: 125%; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;\"><span lang=\"EN-US\" style=\"font-size: 10.5pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: FR;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0 <\/span><b><span style=\"color: green;\">return<\/span><\/b> x <span style=\"color: #666666;\">**<\/span> <span style=\"color: #666666;\">2<\/span><\/span><\/p><p class=\"MsoNormal\" style=\"line-height: 125%; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;\"><span lang=\"EN-US\" style=\"font-size: 10.5pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: FR;\">\u00a0<\/span><\/p><p class=\"MsoNormal\" style=\"line-height: 125%; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;\"><span style=\"font-size: 10.5pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: FR;\">resultat <span style=\"color: #666666;\">=<\/span> carre(<span style=\"color: #666666;\">5<\/span>)<span style=\"mso-spacerun: yes;\">\u00a0 <\/span><i><span style=\"color: #408080;\"># Renvoie 25<\/span><\/i><\/span><\/p><p class=\"MsoNormal\" style=\"line-height: 125%; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;\"><b><span style=\"font-size: 10.5pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: green; mso-fareast-language: FR;\">print<\/span><\/b><span style=\"font-size: 10.5pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: FR;\">(resultat)<\/span><\/p><p class=\"MsoNormal\">\u00a0<\/p><p class=\"MsoNormal\"><b>b. Fonctions \u00e0 plusieurs arguments :<\/b><\/p><p class=\"MsoNormal\">Les fonctions peuvent \u00e9galement avoir plusieurs arguments.<\/p><p class=\"MsoNormal\">\u00a0<\/p><pre style=\"line-height: 125%;\"><b><span lang=\"EN-US\" style=\"font-size: 10.5pt; line-height: 125%; color: green; mso-ansi-language: EN-US;\">def<\/span><\/b><span lang=\"EN-US\" style=\"font-size: 10.5pt; line-height: 125%; mso-ansi-language: EN-US;\"> <span style=\"color: blue;\">additionner<\/span>(x, y):<\/span><\/pre><pre style=\"line-height: 125%;\"><span lang=\"EN-US\" style=\"font-size: 10.5pt; line-height: 125%; mso-ansi-language: EN-US;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0 <\/span><b><span style=\"color: green;\">return<\/span><\/b> x <span style=\"color: #666666;\">+<\/span> y<\/span><\/pre><pre style=\"line-height: 125%;\"><span lang=\"EN-US\" style=\"font-size: 10.5pt; line-height: 125%; mso-ansi-language: EN-US;\">\u00a0<\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\">somme <span style=\"color: #666666;\">=<\/span> additionner(<span style=\"color: #666666;\">3<\/span>, <span style=\"color: #666666;\">4<\/span>)<span style=\"mso-spacerun: yes;\">\u00a0 <\/span><i><span style=\"color: #408080;\"># Renvoie 7<\/span><\/i><\/span><\/pre><pre style=\"line-height: 125%;\"><b><span style=\"font-size: 10.5pt; line-height: 125%; color: green;\">print<\/span><\/b><span style=\"font-size: 10.5pt; line-height: 125%;\">(somme)<\/span><\/pre><p class=\"MsoNormal\">\u00a0<\/p><p class=\"MsoNormal\">L&rsquo;ordre dans lequel vous passez les arguments \u00e0 la fonction est important. Dans l&rsquo;exemple pr\u00e9c\u00e9dent, \u2018x\u2019 est 3 et \u2018y\u2019 est 4.<\/p><p class=\"MsoNormal\">\u00a0<\/p><h2><span class=\"ez-toc-section\" id=\"2_Fonction_renvoyant_un_nombre_aleatoire\"><\/span>2. Fonction renvoyant un nombre al\u00e9atoire<span class=\"ez-toc-section-end\"><\/span><\/h2><p class=\"MsoNormal\">\u00a0<\/p><p class=\"MsoNormal\">Python poss\u00e8de un module int\u00e9gr\u00e9 nomm\u00e9 \u2018random\u2019 qui offre une vari\u00e9t\u00e9 de fonctions pour g\u00e9n\u00e9rer des nombres al\u00e9atoires.<\/p><p class=\"MsoNormal\">\u00a0<\/p><p class=\"MsoNormal\">Pour obtenir un nombre al\u00e9atoire, vous pouvez utiliser la fonction \u2018randint()\u2019 du module \u2018random\u2019.<\/p><p class=\"MsoNormal\">\u00a0<\/p><pre style=\"line-height: 125%;\"><b><span style=\"font-size: 10.5pt; line-height: 125%; color: green;\">import<\/span><\/b><span style=\"font-size: 10.5pt; line-height: 125%;\"> <b><span style=\"color: blue;\">random<\/span><\/b><\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\">\u00a0<\/span><\/pre><pre style=\"line-height: 125%;\"><b><span style=\"font-size: 10.5pt; line-height: 125%; color: green;\">def<\/span><\/b><span style=\"font-size: 10.5pt; line-height: 125%;\"> <span style=\"color: blue;\">obtenir_aleatoire<\/span>(minimum, maximum):<\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0 <\/span><\/span><b><span lang=\"EN-US\" style=\"font-size: 10.5pt; line-height: 125%; color: green; mso-ansi-language: EN-US;\">return<\/span><\/b><span lang=\"EN-US\" style=\"font-size: 10.5pt; line-height: 125%; mso-ansi-language: EN-US;\"> random<span style=\"color: #666666;\">.<\/span>randint(minimum, maximum)<\/span><\/pre><pre style=\"line-height: 125%;\"><span lang=\"EN-US\" style=\"font-size: 10.5pt; line-height: 125%; mso-ansi-language: EN-US;\">\u00a0<\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\">nombre <span style=\"color: #666666;\">=<\/span> obtenir_aleatoire(<span style=\"color: #666666;\">1<\/span>, <span style=\"color: #666666;\">100<\/span>)<span style=\"mso-spacerun: yes;\">\u00a0 <\/span><i><span style=\"color: #408080;\"># Renvoie un nombre entre 1 et 100 inclus<\/span><\/i><\/span><\/pre><pre style=\"line-height: 125%;\"><b><span style=\"font-size: 10.5pt; line-height: 125%; color: green;\">print<\/span><\/b><span style=\"font-size: 10.5pt; line-height: 125%;\">(nombre)<\/span><\/pre><p class=\"MsoNormal\">\u00a0<\/p><h2><span class=\"ez-toc-section\" id=\"3_Serie_statistique_obtenue_par_la_repetition_de_lappel_dune_telle_fonction\"><\/span>3. S\u00e9rie statistique obtenue par la r\u00e9p\u00e9tition de l\u2019appel d\u2019une telle fonction<span class=\"ez-toc-section-end\"><\/span><\/h2><p class=\"MsoNormal\">\u00a0<\/p><p class=\"MsoNormal\">Lorsque vous appelez \u00e0 plusieurs reprises une fonction qui renvoie un nombre al\u00e9atoire, vous obtenez une s\u00e9rie de valeurs. Cette s\u00e9rie peut \u00eatre utilis\u00e9e pour des analyses statistiques ou pour des simulations.<\/p><p class=\"MsoNormal\">\u00a0<\/p><pre style=\"line-height: 125%;\"><b><span style=\"font-size: 10.5pt; line-height: 125%; color: green;\">import<\/span><\/b><span style=\"font-size: 10.5pt; line-height: 125%;\"> <b><span style=\"color: blue;\">random<\/span><\/b><\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\">\u00a0<\/span><\/pre><pre style=\"line-height: 125%;\"><b><span style=\"font-size: 10.5pt; line-height: 125%; color: green;\">def<\/span><\/b><span style=\"font-size: 10.5pt; line-height: 125%;\"> <span style=\"color: blue;\">obtenir_aleatoire<\/span>():<\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0 <\/span><b><span style=\"color: green;\">return<\/span><\/b> random<span style=\"color: #666666;\">.<\/span>randint(<span style=\"color: #666666;\">1<\/span>, <span style=\"color: #666666;\">6<\/span>)<\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\">\u00a0<\/span><\/pre><pre style=\"line-height: 125%;\"><i><span style=\"font-size: 10.5pt; line-height: 125%; color: #408080;\"># Simulons le lancer d'un d\u00e9 100 fois<\/span><\/i><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\">lancers <span style=\"color: #666666;\">=<\/span> [] <i><span style=\"color: #408080;\"># Cr\u00e9e une liste vide<\/span><\/i><\/span><\/pre><pre style=\"line-height: 125%;\"><b><span style=\"font-size: 10.5pt; line-height: 125%; color: green;\">for<\/span><\/b><span style=\"font-size: 10.5pt; line-height: 125%;\"> i <b><span style=\"color: #aa22ff;\">in<\/span><\/b> <span style=\"color: green;\">range<\/span>(<span style=\"color: #666666;\">100<\/span>):<\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0 <\/span>lancers<span style=\"color: #666666;\">.<\/span>append(obtenir_aleatoire()) <i><span style=\"color: #408080;\"># Ajoute un nombre al\u00e9atoire entre 1 et 6 dans la liste<\/span><\/i><\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\">\u00a0<\/span><\/pre><pre style=\"line-height: 125%;\"><b><span style=\"font-size: 10.5pt; line-height: 125%; color: green;\">print<\/span><\/b><span style=\"font-size: 10.5pt; line-height: 125%;\">(lancers)<\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\">\u00a0<\/span><\/pre><pre style=\"line-height: 125%;\"><i><span style=\"font-size: 10.5pt; line-height: 125%; color: #408080;\"># Analyse statistique simple : combien de fois le nombre 6 appara\u00eet<\/span><\/i><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\">nb_six <span style=\"color: #666666;\">=<\/span> lancers<span style=\"color: #666666;\">.<\/span>count(<span style=\"color: #666666;\">6<\/span>)<\/span><\/pre><pre style=\"line-height: 125%;\"><b><span style=\"font-size: 10.5pt; line-height: 125%; color: green;\">print<\/span><\/b><span style=\"font-size: 10.5pt; line-height: 125%;\">(<span style=\"color: #ba2121;\">\"Le nombre 6 est apparu \"<\/span> <span style=\"color: #666666;\">+<\/span> <span style=\"color: green;\">str<\/span>(nb_six) <span style=\"color: #666666;\">+<\/span> <span style=\"color: #ba2121;\">\" fois.\"<\/span>)<\/span><\/pre><p class=\"MsoNormal\">\u00a0<\/p><p class=\"MsoNormal\">Dans cet exemple, nous avons utilis\u00e9 une boucle \u2018for\u2019 pour simuler le lancer d&rsquo;un d\u00e9 100 fois et nous avons ajout\u00e9 chaque r\u00e9sultat \u00e0 la liste \u2018lancers\u2019. Ensuite, nous avons utilis\u00e9 la m\u00e9thode \u2018count\u2019 pour compter le nombre de fois que le chiffre 6 est apparu et nous avons affich\u00e9 ce r\u00e9sultat en utilisant une concat\u00e9nation de cha\u00eenes. La fonction \u2018str()\u2019 est utilis\u00e9e ici pour convertir le nombre \u2018nb_six\u2019 en une cha\u00eene de caract\u00e8res afin qu&rsquo;il puisse \u00eatre concat\u00e9n\u00e9 et affich\u00e9 avec le reste du message textuel.<\/p><p class=\"MsoNormal\">\u00a0<\/p><h1><span class=\"ez-toc-section\" id=\"Methodes\"><\/span>M\u00e9thodes<span class=\"ez-toc-section-end\"><\/span><\/h1><p class=\"MsoNormal\">\u00a0<\/p><h2><span class=\"ez-toc-section\" id=\"1_Ecrire_des_fonctions_simples_et_appeler_une_fonction\"><\/span>1. \u00c9crire des fonctions simples et appeler une fonction<span class=\"ez-toc-section-end\"><\/span><\/h2><p class=\"MsoNormal\">\u00a0<\/p><p class=\"MsoNormal\">Pour \u00e9crire une fonction simple, d\u00e9finissez la fonction avec \u2018def\u2019, suivi du nom de la fonction, des parenth\u00e8ses \u2018()\u2019 contenant les arguments, et terminez avec un deux-points \u2018:\u2019. Le corps de la fonction est indent\u00e9.<\/p><p class=\"MsoNormal\">\u00a0<\/p><pre style=\"line-height: 125%;\"><b><span style=\"font-size: 10.5pt; line-height: 125%; color: green;\">def<\/span><\/b><span style=\"font-size: 10.5pt; line-height: 125%;\"> <span style=\"color: blue;\">saluer<\/span>(nom):<\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0 <\/span><b><span style=\"color: green;\">return<\/span><\/b> <span style=\"color: #ba2121;\">\"Bonjour, \"<\/span> <span style=\"color: #666666;\">+<\/span> nom <span style=\"color: #666666;\">+<\/span> <span style=\"color: #ba2121;\">\"!\"<\/span><\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\">\u00a0<\/span><\/pre><pre style=\"line-height: 125%;\"><i><span style=\"font-size: 10.5pt; line-height: 125%; color: #408080;\"># Appeler la fonction<\/span><\/i><\/pre><pre style=\"line-height: 125%;\"><b><span style=\"font-size: 10.5pt; line-height: 125%; color: green;\">print<\/span><\/b><span style=\"font-size: 10.5pt; line-height: 125%;\">(saluer(<span style=\"color: #ba2121;\">\"Alice\"<\/span>))<span style=\"mso-spacerun: yes;\">\u00a0 <\/span><i><span style=\"color: #408080;\"># Affiche \"Bonjour, Alice!\"<\/span><\/i><\/span><\/pre><p class=\"MsoNormal\">\u00a0<\/p><h2><span class=\"ez-toc-section\" id=\"2_Lire_comprendre_modifier_et_completer_des_fonctions_plus_complexes\"><\/span>2. Lire, comprendre, modifier, et compl\u00e9ter des fonctions plus complexes<span class=\"ez-toc-section-end\"><\/span><\/h2><p class=\"MsoNormal\">\u00a0<\/p><p class=\"MsoNormal\"><b>Comprendre<\/b> :<\/p><p class=\"MsoNormal\">Lorsqu&rsquo;on vous donne une fonction complexe, prenez le temps de lire le code attentivement, en identifiant les arguments, les variables locales, les boucles, les conditions et les instructions de retour.<\/p><p class=\"MsoNormal\">\u00a0<\/p><p class=\"MsoNormal\"><b>Modifier<\/b> :<\/p><p class=\"MsoNormal\">Pour modifier une fonction, vous pouvez changer les valeurs, ajouter ou supprimer des arguments, ou modifier la logique.<\/p><p class=\"MsoNormal\">\u00a0<\/p><p class=\"MsoNormal\"><b>Compl\u00e9ter<\/b> :<\/p><p class=\"MsoNormal\">Pour compl\u00e9ter une fonction, vous pouvez ajouter des conditions suppl\u00e9mentaires, des calculs ou des instructions de retour.<\/p><p class=\"MsoNormal\">\u00a0<\/p><h2><span class=\"ez-toc-section\" id=\"3_Lire_et_comprendre_une_fonction_renvoyant_une_moyenne_un_ecart_type\"><\/span>3. Lire et comprendre une fonction renvoyant une moyenne, un \u00e9cart type<span class=\"ez-toc-section-end\"><\/span><\/h2><p class=\"MsoNormal\">\u00a0<\/p><p class=\"MsoNormal\">Supposons qu&rsquo;on vous donne une fonction qui calcule la moyenne et l&rsquo;\u00e9cart-type d&rsquo;une s\u00e9rie de nombres.<\/p><p class=\"MsoNormal\">\u00a0<\/p><pre style=\"line-height: 125%;\"><b><span style=\"font-size: 10.5pt; line-height: 125%; color: green;\">def<\/span><\/b><span style=\"font-size: 10.5pt; line-height: 125%;\"> <span style=\"color: blue;\">statistiques<\/span>(nombres):<\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0 <\/span>n <span style=\"color: #666666;\">=<\/span> <span style=\"color: green;\">len<\/span>(nombres)<\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0 <\/span>moyenne <span style=\"color: #666666;\">=<\/span> <span style=\"color: green;\">sum<\/span>(nombres) <span style=\"color: #666666;\">\/<\/span> n<\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0 <\/span><\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0<\/span><i><span style=\"color: #408080;\"># Calcul de la variance<\/span><\/i><\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0 <\/span>somme_des_carres <span style=\"color: #666666;\">=<\/span> <span style=\"color: #666666;\">0<\/span><\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0 <\/span><b><span style=\"color: green;\">for<\/span><\/b> x <b><span style=\"color: #aa22ff;\">in<\/span><\/b> nombres:<\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>somme_des_carres <span style=\"color: #666666;\">+=<\/span> (x <span style=\"color: #666666;\">-<\/span> moyenne) <span style=\"color: #666666;\">**<\/span> <span style=\"color: #666666;\">2<\/span><\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0 <\/span>variance <span style=\"color: #666666;\">=<\/span> somme_des_carres <span style=\"color: #666666;\">\/<\/span> n<\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0 <\/span><\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0<\/span>ecart_type <span style=\"color: #666666;\">=<\/span> variance <span style=\"color: #666666;\">**<\/span> <span style=\"color: #666666;\">0.5<\/span><\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0 <\/span><b><span style=\"color: green;\">return<\/span><\/b> moyenne, ecart_type<\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\">\u00a0<\/span><\/pre><pre style=\"line-height: 125%;\"><i><span style=\"font-size: 10.5pt; line-height: 125%; color: #408080;\"># Exemple d'utilisation<\/span><\/i><\/pre><pre style=\"line-height: 125%;\"><b><span style=\"font-size: 10.5pt; line-height: 125%; color: green;\">print<\/span><\/b><span style=\"font-size: 10.5pt; line-height: 125%;\">(statistiques([<span style=\"color: #666666;\">1<\/span>, <span style=\"color: #666666;\">2<\/span>, <span style=\"color: #666666;\">3<\/span>, <span style=\"color: #666666;\">4<\/span>, <span style=\"color: #666666;\">5<\/span>]))<span style=\"mso-spacerun: yes;\">\u00a0 <\/span><i><span style=\"color: #408080;\"># Affiche (3.0, 1.4142135623730951)<\/span><\/i><\/span><\/pre><p class=\"MsoNormal\">\u00a0<\/p><p class=\"MsoNormal\">Ici, la fonction \u2018statistiques\u2019 prend une liste de nombres, calcule leur moyenne et leur \u00e9cart-type, et renvoie ces valeurs.<\/p><p class=\"MsoNormal\">\u00a0<\/p><h2><span class=\"ez-toc-section\" id=\"4_Ecrire_des_fonctions_renvoyant_le_resultat_numerique_dune_experience_aleatoire_dune_repetition_dexperiences_aleatoires_independantes\"><\/span>4. \u00c9crire des fonctions renvoyant le r\u00e9sultat num\u00e9rique d&rsquo;une exp\u00e9rience al\u00e9atoire, d\u2019une r\u00e9p\u00e9tition d&rsquo;exp\u00e9riences al\u00e9atoires ind\u00e9pendantes<span class=\"ez-toc-section-end\"><\/span><\/h2><p class=\"MsoNormal\">\u00a0<\/p><p class=\"MsoNormal\"><b>Exp\u00e9rience al\u00e9atoire<\/b> :<\/p><p class=\"MsoNormal\">Une exp\u00e9rience al\u00e9atoire peut \u00eatre simul\u00e9e en utilisant le module `random`.<\/p><p class=\"MsoNormal\">\u00a0<\/p><pre style=\"line-height: 125%;\"><b><span style=\"font-size: 10.5pt; line-height: 125%; color: green;\">import<\/span><\/b><span style=\"font-size: 10.5pt; line-height: 125%;\"> <b><span style=\"color: blue;\">random<\/span><\/b><\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\">\u00a0<\/span><\/pre><pre style=\"line-height: 125%;\"><b><span style=\"font-size: 10.5pt; line-height: 125%; color: green;\">def<\/span><\/b><span style=\"font-size: 10.5pt; line-height: 125%;\"> <span style=\"color: blue;\">lancer_de<\/span>():<\/span><\/pre><pre style=\"line-height: 125%;\"><span style=\"font-size: 10.5pt; line-height: 125%;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0 <\/span><b><span style=\"color: green;\">return<\/span><\/b> random<span style=\"color: #666666;\">.<\/span>randint(<span style=\"color: #666666;\">1<\/span>, <span style=\"color: #666666;\">6<\/span>)<\/span><\/pre><p class=\"MsoNormal\">\u00a0<\/p><p class=\"MsoNormal\"><b>R\u00e9p\u00e9tition d&rsquo;exp\u00e9riences al\u00e9atoires<\/b> :<\/p><p class=\"MsoNormal\">Vous pouvez \u00e9galement cr\u00e9er une fonction qui simule la r\u00e9p\u00e9tition de ces exp\u00e9riences.<\/p><p class=\"MsoNormal\">\u00a0<\/p><pre style=\"line-height: 125%;\"><b><span lang=\"EN-US\" style=\"font-size: 10.5pt; line-height: 125%; color: green; mso-ansi-language: EN-US;\">def<\/span><\/b><span lang=\"EN-US\" style=\"font-size: 10.5pt; line-height: 125%; mso-ansi-language: EN-US;\"> <span style=\"color: blue;\">repeter_lancers<\/span>(n):<\/span><\/pre><pre style=\"line-height: 125%;\"><span lang=\"EN-US\" style=\"font-size: 10.5pt; line-height: 125%; mso-ansi-language: EN-US;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0 <\/span><b><span style=\"color: green;\">return<\/span><\/b> [lancer_de() <b><span style=\"color: green;\">for<\/span><\/b> _ <b><span style=\"color: #aa22ff;\">in<\/span><\/b> <span style=\"color: green;\">range<\/span>(n)]<\/span><\/pre><pre style=\"line-height: 125%;\"><span lang=\"EN-US\" style=\"font-size: 10.5pt; line-height: 125%; mso-ansi-language: EN-US;\">\u00a0<\/span><\/pre><pre style=\"line-height: 125%;\"><i><span style=\"font-size: 10.5pt; line-height: 125%; color: #408080;\"># Exemple d'utilisation<\/span><\/i><\/pre><pre style=\"line-height: 125%;\"><b><span style=\"font-size: 10.5pt; line-height: 125%; color: green;\">print<\/span><\/b><span style=\"font-size: 10.5pt; line-height: 125%;\">(repeter_lancers(<span style=\"color: #666666;\">10<\/span>))<span style=\"mso-spacerun: yes;\">\u00a0 <\/span><i><span style=\"color: #408080;\"># Affiche une liste de 10 lancers de d\u00e9<\/span><\/i><\/span><\/pre><p class=\"MsoNormal\">\u00a0<\/p><p class=\"MsoNormal\">En ma\u00eetrisant ces m\u00e9thodes, vous pouvez cr\u00e9er des fonctions personnalis\u00e9es pour r\u00e9soudre des probl\u00e8mes sp\u00e9cifiques et analyser des donn\u00e9es de mani\u00e8re programmatique.<\/p><p><style>@font-face\n\t{font-family:\"Cambria Math\";\n\tpanose-1:2 4 5 3 5 4 6 3 2 4;\n\tmso-font-charset:0;\n\tmso-generic-font-family:roman;\n\tmso-font-pitch:variable;\n\tmso-font-signature:-536870145 1107305727 0 0 415 0;}@font-face\n\t{font-family:Calibri;\n\tpanose-1:2 15 5 2 2 2 4 3 2 4;\n\tmso-font-charset:0;\n\tmso-generic-font-family:swiss;\n\tmso-font-pitch:variable;\n\tmso-font-signature:-536859905 -1073732485 9 0 511 0;}@font-face\n\t{font-family:\"Calibri Light\";\n\tpanose-1:2 15 3 2 2 2 4 3 2 4;\n\tmso-font-charset:0;\n\tmso-generic-font-family:swiss;\n\tmso-font-pitch:variable;\n\tmso-font-signature:-469750017 -1073732485 9 0 511 0;}p.MsoNormal, li.MsoNormal, div.MsoNormal\n\t{mso-style-unhide:no;\n\tmso-style-qformat:yes;\n\tmso-style-parent:\"\";\n\tmargin:0cm;\n\tmso-pagination:widow-orphan;\n\tfont-size:12.0pt;\n\tfont-family:\"Calibri\",sans-serif;\n\tmso-ascii-font-family:Calibri;\n\tmso-ascii-theme-font:minor-latin;\n\tmso-fareast-font-family:Calibri;\n\tmso-fareast-theme-font:minor-latin;\n\tmso-hansi-font-family:Calibri;\n\tmso-hansi-theme-font:minor-latin;\n\tmso-bidi-font-family:\"Times New Roman\";\n\tmso-bidi-theme-font:minor-bidi;\n\tmso-fareast-language:EN-US;}h1\n\t{mso-style-priority:9;\n\tmso-style-unhide:no;\n\tmso-style-qformat:yes;\n\tmso-style-link:\"Titre 1 Car\";\n\tmso-style-next:Normal;\n\tmargin-top:12.0pt;\n\tmargin-right:0cm;\n\tmargin-bottom:0cm;\n\tmargin-left:0cm;\n\tmso-pagination:widow-orphan lines-together;\n\tpage-break-after:avoid;\n\tmso-outline-level:1;\n\tfont-size:16.0pt;\n\tfont-family:\"Calibri Light\",sans-serif;\n\tmso-ascii-font-family:\"Calibri Light\";\n\tmso-ascii-theme-font:major-latin;\n\tmso-fareast-font-family:\"Times New Roman\";\n\tmso-fareast-theme-font:major-fareast;\n\tmso-hansi-font-family:\"Calibri Light\";\n\tmso-hansi-theme-font:major-latin;\n\tmso-bidi-font-family:\"Times New Roman\";\n\tmso-bidi-theme-font:major-bidi;\n\tcolor:#2F5496;\n\tmso-themecolor:accent1;\n\tmso-themeshade:191;\n\tmso-font-kerning:0pt;\n\tmso-fareast-language:EN-US;\n\tfont-weight:normal;}h2\n\t{mso-style-priority:9;\n\tmso-style-qformat:yes;\n\tmso-style-link:\"Titre 2 Car\";\n\tmso-style-next:Normal;\n\tmargin-top:2.0pt;\n\tmargin-right:0cm;\n\tmargin-bottom:0cm;\n\tmargin-left:0cm;\n\tmso-pagination:widow-orphan lines-together;\n\tpage-break-after:avoid;\n\tmso-outline-level:2;\n\tfont-size:13.0pt;\n\tfont-family:\"Calibri Light\",sans-serif;\n\tmso-ascii-font-family:\"Calibri Light\";\n\tmso-ascii-theme-font:major-latin;\n\tmso-fareast-font-family:\"Times New Roman\";\n\tmso-fareast-theme-font:major-fareast;\n\tmso-hansi-font-family:\"Calibri Light\";\n\tmso-hansi-theme-font:major-latin;\n\tmso-bidi-font-family:\"Times New Roman\";\n\tmso-bidi-theme-font:major-bidi;\n\tcolor:#2F5496;\n\tmso-themecolor:accent1;\n\tmso-themeshade:191;\n\tmso-fareast-language:EN-US;\n\tfont-weight:normal;}pre\n\t{mso-style-noshow:yes;\n\tmso-style-priority:99;\n\tmso-style-link:\"Pr\u00e9format\u00e9 HTML Car\";\n\tmargin:0cm;\n\tmargin-bottom:.0001pt;\n\tmso-pagination:widow-orphan;\n\tfont-size:10.0pt;\n\tfont-family:\"Courier New\";\n\tmso-fareast-font-family:\"Times New Roman\";}span.Titre1Car\n\t{mso-style-name:\"Titre 1 Car\";\n\tmso-style-priority:9;\n\tmso-style-unhide:no;\n\tmso-style-locked:yes;\n\tmso-style-link:\"Titre 1\";\n\tmso-ansi-font-size:16.0pt;\n\tmso-bidi-font-size:16.0pt;\n\tfont-family:\"Calibri Light\",sans-serif;\n\tmso-ascii-font-family:\"Calibri Light\";\n\tmso-ascii-theme-font:major-latin;\n\tmso-fareast-font-family:\"Times New Roman\";\n\tmso-fareast-theme-font:major-fareast;\n\tmso-hansi-font-family:\"Calibri Light\";\n\tmso-hansi-theme-font:major-latin;\n\tmso-bidi-font-family:\"Times New Roman\";\n\tmso-bidi-theme-font:major-bidi;\n\tcolor:#2F5496;\n\tmso-themecolor:accent1;\n\tmso-themeshade:191;}span.Titre2Car\n\t{mso-style-name:\"Titre 2 Car\";\n\tmso-style-priority:9;\n\tmso-style-unhide:no;\n\tmso-style-locked:yes;\n\tmso-style-link:\"Titre 2\";\n\tmso-ansi-font-size:13.0pt;\n\tmso-bidi-font-size:13.0pt;\n\tfont-family:\"Calibri Light\",sans-serif;\n\tmso-ascii-font-family:\"Calibri Light\";\n\tmso-ascii-theme-font:major-latin;\n\tmso-fareast-font-family:\"Times New Roman\";\n\tmso-fareast-theme-font:major-fareast;\n\tmso-hansi-font-family:\"Calibri Light\";\n\tmso-hansi-theme-font:major-latin;\n\tmso-bidi-font-family:\"Times New Roman\";\n\tmso-bidi-theme-font:major-bidi;\n\tcolor:#2F5496;\n\tmso-themecolor:accent1;\n\tmso-themeshade:191;}span.PrformatHTMLCar\n\t{mso-style-name:\"Pr\u00e9format\u00e9 HTML Car\";\n\tmso-style-noshow:yes;\n\tmso-style-priority:99;\n\tmso-style-unhide:no;\n\tmso-style-locked:yes;\n\tmso-style-link:\"Pr\u00e9format\u00e9 HTML\";\n\tmso-ansi-font-size:10.0pt;\n\tmso-bidi-font-size:10.0pt;\n\tfont-family:\"Courier New\";\n\tmso-ascii-font-family:\"Courier New\";\n\tmso-fareast-font-family:\"Times New Roman\";\n\tmso-hansi-font-family:\"Courier New\";\n\tmso-bidi-font-family:\"Courier New\";\n\tmso-fareast-language:FR;}.MsoChpDefault\n\t{mso-style-type:export-only;\n\tmso-default-props:yes;\n\tfont-family:\"Calibri\",sans-serif;\n\tmso-ascii-font-family:Calibri;\n\tmso-ascii-theme-font:minor-latin;\n\tmso-fareast-font-family:Calibri;\n\tmso-fareast-theme-font:minor-latin;\n\tmso-hansi-font-family:Calibri;\n\tmso-hansi-theme-font:minor-latin;\n\tmso-bidi-font-family:\"Times New Roman\";\n\tmso-bidi-theme-font:minor-bidi;\n\tmso-fareast-language:EN-US;}div.WordSection1\n\t{page:WordSection1;}<\/style><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-854e1d3 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"854e1d3\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8392cf9\" data-id=\"8392cf9\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-071e74f elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"071e74f\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8c43dc4\" data-id=\"8c43dc4\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-aa0c527 elementor-widget elementor-widget-spacer\" data-id=\"aa0c527\" data-element_type=\"widget\" data-widget_type=\"spacer.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-spacer\">\n\t\t\t<div class=\"elementor-spacer-inner\"><\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-3c0ad71 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3c0ad71\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-a39de31\" data-id=\"a39de31\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-342de24 elementor-widget elementor-widget-spacer\" data-id=\"342de24\" data-element_type=\"widget\" data-widget_type=\"spacer.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-spacer\">\n\t\t\t<div class=\"elementor-spacer-inner\"><\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>La notion de fonction Introduction \u00a0 En programmation, une fonction est un ensemble d&rsquo;instructions qui accomplissent une t\u00e2che sp\u00e9cifique. Les fonctions permettent d&rsquo;organiser le code en segments r\u00e9utilisables, facilitant ainsi la maintenance, la lisibilit\u00e9 et la modularit\u00e9. Que ce soit pour des calculs math\u00e9matiques simples ou pour des simulations statistiques plus complexes, les fonctions sont [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"elementor_canvas","format":"standard","meta":{"footnotes":""},"categories":[25,26,5],"tags":[],"_links":{"self":[{"href":"https:\/\/www.maxdecours.com\/maxblog\/wp-json\/wp\/v2\/posts\/1980"}],"collection":[{"href":"https:\/\/www.maxdecours.com\/maxblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.maxdecours.com\/maxblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.maxdecours.com\/maxblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.maxdecours.com\/maxblog\/wp-json\/wp\/v2\/comments?post=1980"}],"version-history":[{"count":4,"href":"https:\/\/www.maxdecours.com\/maxblog\/wp-json\/wp\/v2\/posts\/1980\/revisions"}],"predecessor-version":[{"id":1984,"href":"https:\/\/www.maxdecours.com\/maxblog\/wp-json\/wp\/v2\/posts\/1980\/revisions\/1984"}],"wp:attachment":[{"href":"https:\/\/www.maxdecours.com\/maxblog\/wp-json\/wp\/v2\/media?parent=1980"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.maxdecours.com\/maxblog\/wp-json\/wp\/v2\/categories?post=1980"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.maxdecours.com\/maxblog\/wp-json\/wp\/v2\/tags?post=1980"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}