{"id":16,"date":"2025-09-03T21:25:04","date_gmt":"2025-09-03T19:25:04","guid":{"rendered":"https:\/\/yb-isn.fr\/2025\/nsi\/?p=16"},"modified":"2025-09-03T21:25:04","modified_gmt":"2025-09-03T19:25:04","slug":"1-coder-en-python","status":"publish","type":"post","link":"https:\/\/yb-isn.fr\/2025\/nsi\/2025\/09\/03\/1-coder-en-python\/","title":{"rendered":"1-Coder en python"},"content":{"rendered":"<p><!--more--><\/p>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/yb-isn.fr\/2024\/nsi\/wp-content\/uploads\/2024\/08\/image-3.png\" alt=\"\" class=\"wp-image-96\"\/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Nous allons aborder ou consolider les bases du langage python dans un environnement de d\u00e9veloppement classique.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-black-color has-text-color has-background has-link-color wp-elements-2904168a5c12af304f07ac1fbcd2969e\" style=\"background:linear-gradient(135deg,rgb(216,244,179) 0%,rgb(17,184,81) 100%)\">1-) Le langage python<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">L&rsquo;informatique est un domaine d&rsquo;activit\u00e9 scientifique, technique et industriel concernant le traitement automatique de l&rsquo;information par des machines qui ex\u00e9cutent des programmes informatiques.<strong> <\/strong>On entend par machines les syst\u00e8mes embarqu\u00e9s, les ordinateurs, les robots, les automates, etc. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/yb-isn.fr\/2023\/nsi\/wp-content\/uploads\/2023\/09\/flowRoot9531.png\" alt=\"\" class=\"wp-image-104\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"> <a href=\"https:\/\/interstices.info\/les-donnees-en-question\/\">https:\/\/interstices.info\/les-donnees-en-question\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/interstices.info\/comment-fonctionne-une-machine-de-turing\/\">https:\/\/interstices.info\/comment-fonctionne-une-machine-de-turing\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Grace aux travaux de Turing Von Neumann a d\u00e9fini en 1944 l\u2019architecture d\u2019un ordinateur.<br><a href=\"https:\/\/interstices.info\/le-modele-darchitecture-de-von-neumann\/\">https:\/\/interstices.info\/le-modele-darchitecture-de-von-neumann\/<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/yb-isn.fr\/2023\/nsi\/wp-content\/uploads\/2023\/09\/vn.jpg\" alt=\"\" class=\"wp-image-105\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">L\u2019unit\u00e9 de commande ou de contr\u00f4le r\u00e9cup\u00e8re les informations dans la m\u00e9moire et donne les ordres \u00e0 l\u2019UAL.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">L\u2019unit\u00e9 arithm\u00e9tique et logique ALU (ou UAL) ex\u00e9cute les instructions du programme une par une en commen\u00e7ant par la premi\u00e8re (calculs , les op\u00e9rations logiques les comparaisons.)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Les entr\u00e9es et sorties permettent de communiquer avec le monde ext\u00e9rieur.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">La m\u00e9moire stocke le programme ( donn\u00e9es et instructions) en binaire.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>&nbsp;&nbsp;<\/strong>Avec une ligne de code en python on peut afficher \u00ab\u00a0Hello world!\u00a0\u00bb :<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"http:\/\/yb-isn.fr\/spe-physique-2020\/wp-content\/uploads\/2021\/06\/hellopython.png\" alt=\"\" class=\"wp-image-830\"\/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Python est un langage de haut niveau donc tr\u00e8s compr\u00e9hensible par un humain. On obtient le m\u00eame r\u00e9sultat en binaire avec le code ci-dessous.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"http:\/\/yb-isn.fr\/spe-physique-2020\/wp-content\/uploads\/2021\/06\/binhello-145x300.png\" alt=\"\" class=\"wp-image-829\"\/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Le programme en binaire&nbsp; (de bas niveau) est le langage compr\u00e9hensible par la machine.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"http:\/\/yb-isn.fr\/spe-physique-2020\/wp-content\/uploads\/2021\/06\/bashautniveau-300x262.png\" alt=\"\" class=\"wp-image-828\"\/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Le langage de haut niveau python&nbsp;a \u00e9t\u00e9 cr\u00e9e en 1991 par Guido Van Rossum<\/p>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-831\" src=\"http:\/\/yb-isn.fr\/spe-physique-2020\/wp-content\/uploads\/2021\/06\/guido-300x179.jpg\" alt=\"\" style=\"\">.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Python est r\u00e9put\u00e9 \u00eatre facile \u00e0 apprendre concis et clair.C\u2019est un langage open source ce qui signifie que sa licence respecte les crit\u00e8res&nbsp;:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Acc\u00e8s au code source<\/li>\n\n\n\n<li>Cr\u00e9ations de produit d\u00e9riv\u00e9s<\/li>\n\n\n\n<li>Libre redistribution<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Enfin, les nombreuses biblioth\u00e8ques et packages d\u00e9velopp\u00e9s par la communaut\u00e9 d\u2019utilisateurs constituent un v\u00e9ritable avantage. On peut ainsi se lancer dans des projets sans devoir commencer \u00e0 coder en partant de rien.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.lebigdata.fr\/pourquoi-apprendre-python\">https:\/\/www.lebigdata.fr\/pourquoi-apprendre-python<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Guido Van Rossum&nbsp;: <em>\u00ab Je n\u2019imaginais pas que le langage informatique Python conna\u00eetrait un tel succ\u00e8s \u00bb<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-black-color has-text-color has-background has-link-color wp-elements-077ed33150c9eaaa53d4681b59a9718b\" style=\"background:linear-gradient(135deg,rgb(216,244,179) 0%,rgb(17,184,81) 100%)\">2-) Le binaire et l&rsquo;hexad\u00e9cimal<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pixees.fr\/compter-en-binaire\/\">https:\/\/pixees.fr\/compter-en-binaire\/<\/a><\/p>\n\n\n\n<p class=\"has-small-font-size wp-block-paragraph\">Le syst\u00e8me d\u00e9cimal est un syst\u00e8me de num\u00e9ration de position en base 10 . Les unit\u00e9s les dizaines les centaines sont des puissances de 10. Exemple du nombre 235 \u00e9crit dans notre base naturelle .<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/yb-isn.fr\/2023\/nsi\/wp-content\/uploads\/2023\/09\/23510.png\" alt=\"\" class=\"wp-image-107\"\/><\/figure>\n\n\n\n<p class=\"has-small-font-size wp-block-paragraph\"> Le syst\u00e8me binaire est un syst\u00e8me de num\u00e9ration de position en base 2 . Les unit\u00e9s les dizaines les centaines sont des puissances de 2. <\/p>\n\n\n\n<p class=\"has-vivid-red-color has-text-color has-small-font-size wp-block-paragraph\">1- A l&rsquo;aide d&rsquo;un  tableur ou d&rsquo;une calculatrice remplacer les puissances de 10 du tableau ci-dessus par des puissances de 2.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-vivid-red-color has-text-color has-small-font-size wp-block-paragraph\">2- Exploiter le tableau pour \u00e9crire 235 en base 2<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/yb-isn.fr\/2023\/nsi\/wp-content\/uploads\/2023\/09\/2352.png\" alt=\"\" class=\"wp-image-108\"\/><\/figure>\n\n\n\n<p class=\"has-vivid-red-color has-text-color has-small-font-size wp-block-paragraph\">3-Utiliser la calculatrice de windows en mode programmeur pour effectuer les changements de base dans les deux sens afin de v\u00e9rifier le r\u00e9sultat obtenu.<\/p>\n\n\n\n<p class=\"has-vivid-red-color has-text-color has-small-font-size wp-block-paragraph\">4-Expliquez le r\u00e9sultat donn\u00e9 par la calculatrice <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/yb-isn.fr\/2023\/nsi\/wp-content\/uploads\/2023\/09\/calc.png\" alt=\"\" class=\"wp-image-109\"\/><\/figure>\n\n\n\n<p class=\"has-text-color has-small-font-size wp-block-paragraph\" style=\"color:#d91111\">5-Le programme \u00ab&nbsp;Hello world&nbsp;!&nbsp;\u00bb &nbsp;en langage machine est aussi &nbsp;\u00e9crit en hexad\u00e9cimal.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/yb-isn.fr\/2023\/nsi\/wp-content\/uploads\/2023\/09\/hwassembleur-1.jpg\" alt=\"\" class=\"wp-image-110\"\/><\/figure>\n\n\n\n<p class=\"has-vivid-red-color has-text-color has-small-font-size wp-block-paragraph\">6- Mettre la calculatrice en hexad\u00e9cimal et saisissez les deux premi\u00e8res lettres \u00ab\u00a0BA\u00a0\u00bb du code hexad\u00e9cimal. <\/p>\n\n\n\n<p class=\"has-vivid-red-color has-text-color has-small-font-size wp-block-paragraph\">Observer le r\u00e9sultat en binaire.Que remarquez vous&nbsp;?  <\/p>\n\n\n\n<h3 class=\"wp-block-heading has-black-color has-text-color has-background has-link-color wp-elements-8474c00b45fcfb0623c84c0d89fe68de\" style=\"background:linear-gradient(135deg,rgb(216,244,179) 0%,rgb(17,184,81) 100%)\">3-) Installation d&rsquo;un EDI<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Pour coder en python il vous faudra un&nbsp; EDI (Environnement de D\u00e9veloppement Int\u00e9gr\u00e9) ou IDE (Integrated d\u00e9veloppement&nbsp;environnement)&nbsp;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft\"><img decoding=\"async\" src=\"http:\/\/yb-isn.fr\/spe-physique-2020\/wp-content\/uploads\/2021\/06\/th.png\" alt=\"\" class=\"wp-image-833\"\/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Thonny est est un excellent IDE Python, en particulier pour les d\u00e9butants.<a href=\"https:\/\/thonny.org\/\">https:\/\/thonny.org\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">L\u00e9ger son installation est tr\u00e8s facile et int\u00e8gre une version r\u00e9cente de python.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/yb-isn.fr\/video-spe-phy\/installthonny.mp4\">http:\/\/yb-isn.fr\/video-spe-phy\/installthonny.mp4<\/a><\/p>\n\n\n\n<video width=\"320\" height=\"240\" controls>\r\n  <source src=\"http:\/\/yb-isn.fr\/video-spe-phy\/installthonny.mp4\" type=\"video\/mp4\">\r\n<\/video>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-black-color has-text-color has-background has-link-color wp-elements-36a78b3126274b97c1a1f051f8af20c3\" style=\"background:linear-gradient(135deg,rgb(216,244,179) 0%,rgb(17,184,81) 100%)\">4-) EDI classique : Thonny <\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/yb-isn.fr\/python\/wp-content\/uploads\/2023\/06\/activite.png\" alt=\"\" class=\"wp-image-210\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Ouvrir Thonny qui se trouve (au lyc\u00e9e) dans le dossier programmation sur le bureau Windows<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Saisir ou copier-coller les deux lignes de code ci-dessous dans la zone d&rsquo;\u00e9dition.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ex\u00e9cutez le programme<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"godzilla\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">a=2\nprint(a)<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/yb-isn.fr\/python\/wp-content\/uploads\/2023\/06\/image-1.png\" alt=\"\" class=\"wp-image-208\" style=\"width:435px;height:401px\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-16","post","type-post","status-publish","format-standard","hentry","category-non-classe"],"_links":{"self":[{"href":"https:\/\/yb-isn.fr\/2025\/nsi\/wp-json\/wp\/v2\/posts\/16","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yb-isn.fr\/2025\/nsi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yb-isn.fr\/2025\/nsi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yb-isn.fr\/2025\/nsi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yb-isn.fr\/2025\/nsi\/wp-json\/wp\/v2\/comments?post=16"}],"version-history":[{"count":1,"href":"https:\/\/yb-isn.fr\/2025\/nsi\/wp-json\/wp\/v2\/posts\/16\/revisions"}],"predecessor-version":[{"id":17,"href":"https:\/\/yb-isn.fr\/2025\/nsi\/wp-json\/wp\/v2\/posts\/16\/revisions\/17"}],"wp:attachment":[{"href":"https:\/\/yb-isn.fr\/2025\/nsi\/wp-json\/wp\/v2\/media?parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yb-isn.fr\/2025\/nsi\/wp-json\/wp\/v2\/categories?post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yb-isn.fr\/2025\/nsi\/wp-json\/wp\/v2\/tags?post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}