<!DOCTYPE html> <html lang="fr-FR" class="no-js no-svg"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="profile" href="http://gmpg.org/xfn/11"> <script>(function(html){html.className = html.className.replace(/\bno-js\b/,'js')})(document.documentElement);</script> <title>Les chaines de caractères et les types construits en Python – Informatique & Mathématiques</title> <!-- This site is optimized with the Yoast SEO plugin v12.0 - https://yoast.com/wordpress/plugins/seo/ --> <link rel="canonical" href="http://rpcnufrlkr.cluster006.ovh.net/olga/les-chaines-de-caracteres-et-les-types-construits-en-python/" /> <meta property="og:locale" content="fr_FR" /> <meta property="og:type" content="article" /> <meta property="og:title" content="Les chaines de caractères et les types construits en Python – Informatique & Mathématiques" /> <meta property="og:description" content=" Chaînes Tuples Listes Dictionnaires Type Str Tuple List Dict Création Les clés peuvent être detype int, float, str outuples non mutables Longueur Valeur d’indice i d’indice i d’indice i associée à une clé d’indice i à j-1 d’indice i à j-1 d’indice i à j-1 à partir de l’indice i à partir … Continuer la lecture de « Les chaines de caractères et les types construits en Python »" /> <meta property="og:url" content="http://rpcnufrlkr.cluster006.ovh.net/olga/les-chaines-de-caracteres-et-les-types-construits-en-python/" /> <meta property="og:site_name" content="Informatique & Mathématiques" /> <meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:description" content=" Chaînes Tuples Listes Dictionnaires Type Str Tuple List Dict Création Les clés peuvent être detype int, float, str outuples non mutables Longueur Valeur d’indice i d’indice i d’indice i associée à une clé d’indice i à j-1 d’indice i à j-1 d’indice i à j-1 à partir de l’indice i à partir … Continuer la lecture de « Les chaines de caractères et les types construits en Python »" /> <meta name="twitter:title" content="Les chaines de caractères et les types construits en Python – Informatique & Mathématiques" /> <script type='application/ld+json' class='yoast-schema-graph yoast-schema-graph--main'>{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"http://rpcnufrlkr.cluster006.ovh.net/olga/#organization","name":"Math\u00e9matiques et informatiques","url":"http://rpcnufrlkr.cluster006.ovh.net/olga/","sameAs":[],"logo":{"@type":"ImageObject","@id":"http://rpcnufrlkr.cluster006.ovh.net/olga/#logo","url":"http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/uploads/2017/11/laptop_chromebook.png","width":64,"height":64,"caption":"Math\u00e9matiques et informatiques"},"image":{"@id":"http://rpcnufrlkr.cluster006.ovh.net/olga/#logo"}},{"@type":"WebSite","@id":"http://rpcnufrlkr.cluster006.ovh.net/olga/#website","url":"http://rpcnufrlkr.cluster006.ovh.net/olga/","name":"Informatique & Math\u00e9matiques","publisher":{"@id":"http://rpcnufrlkr.cluster006.ovh.net/olga/#organization"},"potentialAction":{"@type":"SearchAction","target":"http://rpcnufrlkr.cluster006.ovh.net/olga/?s={search_term_string}","query-input":"required name=search_term_string"}},{"@type":"WebPage","@id":"http://rpcnufrlkr.cluster006.ovh.net/olga/les-chaines-de-caracteres-et-les-types-construits-en-python/#webpage","url":"http://rpcnufrlkr.cluster006.ovh.net/olga/les-chaines-de-caracteres-et-les-types-construits-en-python/","inLanguage":"fr-FR","name":"Les chaines de caract\u00e8res et les types construits en Python – Informatique & Math\u00e9matiques","isPartOf":{"@id":"http://rpcnufrlkr.cluster006.ovh.net/olga/#website"},"datePublished":"2020-01-12T13:45:27+00:00","dateModified":"2020-09-23T18:02:22+00:00"}]}</script> <!-- / Yoast SEO plugin. --> <link rel='dns-prefetch' href='//fonts.googleapis.com' /> <link rel='dns-prefetch' href='//maxcdn.bootstrapcdn.com' /> <link rel='dns-prefetch' href='//s.w.org' /> <link href='https://fonts.gstatic.com' crossorigin rel='preconnect' /> <link rel="alternate" type="application/rss+xml" title="Informatique & Mathématiques » Flux" href="http://rpcnufrlkr.cluster006.ovh.net/olga/feed/" /> <link rel="alternate" type="application/rss+xml" title="Informatique & Mathématiques » Flux des commentaires" href="http://rpcnufrlkr.cluster006.ovh.net/olga/comments/feed/" /> <script type="text/javascript"> window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/12.0.0-1\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/12.0.0-1\/svg\/","svgExt":".svg","source":{"concatemoji":"http:\/\/rpcnufrlkr.cluster006.ovh.net\/olga\/wp-includes\/js\/wp-emoji-release.min.js?ver=5.2.13"}}; !function(e,a,t){var n,r,o,i=a.createElement("canvas"),p=i.getContext&&i.getContext("2d");function s(e,t){var a=String.fromCharCode;p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,e),0,0);e=i.toDataURL();return p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,t),0,0),e===i.toDataURL()}function c(e){var t=a.createElement("script");t.src=e,t.defer=t.type="text/javascript",a.getElementsByTagName("head")[0].appendChild(t)}for(o=Array("flag","emoji"),t.supports={everything:!0,everythingExceptFlag:!0},r=0;r<o.length;r++)t.supports[o[r]]=function(e){if(!p||!p.fillText)return!1;switch(p.textBaseline="top",p.font="600 32px Arial",e){case"flag":return s([55356,56826,55356,56819],[55356,56826,8203,55356,56819])?!1:!s([55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447],[55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447]);case"emoji":return!s([55357,56424,55356,57342,8205,55358,56605,8205,55357,56424,55356,57340],[55357,56424,55356,57342,8203,55358,56605,8203,55357,56424,55356,57340])}return!1}(o[r]),t.supports.everything=t.supports.everything&&t.supports[o[r]],"flag"!==o[r]&&(t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&t.supports[o[r]]);t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&!t.supports.flag,t.DOMReady=!1,t.readyCallback=function(){t.DOMReady=!0},t.supports.everything||(n=function(){t.readyCallback()},a.addEventListener?(a.addEventListener("DOMContentLoaded",n,!1),e.addEventListener("load",n,!1)):(e.attachEvent("onload",n),a.attachEvent("onreadystatechange",function(){"complete"===a.readyState&&t.readyCallback()})),(n=t.source||{}).concatemoji?c(n.concatemoji):n.wpemoji&&n.twemoji&&(c(n.twemoji),c(n.wpemoji)))}(window,document,window._wpemojiSettings); </script> <style type="text/css"> img.wp-smiley, img.emoji { display: inline !important; border: none !important; box-shadow: none !important; height: 1em !important; width: 1em !important; margin: 0 .07em !important; vertical-align: -0.1em !important; background: none !important; padding: 0 !important; } </style> <link rel='stylesheet' id='wp-block-library-css' href='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-includes/css/dist/block-library/style.min.css?ver=5.2.13' type='text/css' media='all' /> <link rel='stylesheet' id='contact-form-7-css' href='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/plugins/contact-form-7/includes/css/styles.css?ver=5.1.4' type='text/css' media='all' /> <link rel='stylesheet' id='ez-icomoon-css' href='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/plugins/easy-table-of-contents/vendor/icomoon/style.min.css?ver=1.7' type='text/css' media='all' /> <link rel='stylesheet' id='ez-toc-css' href='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/plugins/easy-table-of-contents/assets/css/screen.min.css?ver=1.7' type='text/css' media='all' /> <style id='ez-toc-inline-css' type='text/css'> div#ez-toc-container p.ez-toc-title {font-size: 120%;}div#ez-toc-container p.ez-toc-title {font-weight: 500;}div#ez-toc-container ul li {font-size: 100%;}div#ez-toc-container {width: 100%;} </style> <link rel='stylesheet' id='twentyseventeen-fonts-css' href='https://fonts.googleapis.com/css?family=Libre+Franklin%3A300%2C300i%2C400%2C400i%2C600%2C600i%2C800%2C800i&subset=latin%2Clatin-ext' type='text/css' media='all' /> <link rel='stylesheet' id='twentyseventeen-style-css' href='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/themes/twentyseventeen-olga/style.css?ver=0.1.1508061281' type='text/css' media='all' /> <!--[if lt IE 9]> <link rel='stylesheet' id='twentyseventeen-ie8-css' href='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/themes/twentyseventeen/assets/css/ie8.css?ver=1.0' type='text/css' media='all' /> <![endif]--> <link rel='stylesheet' id='font-awesome-css' href='//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css?ver=4.3.0' type='text/css' media='all' /> <link rel='stylesheet' id='dkpdf-frontend-css' href='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/plugins/dk-pdf/assets/css/frontend.css?ver=1.9.6' type='text/css' media='all' /> <link rel='stylesheet' id='enlighter-local-css' href='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/plugins/enlighter/resources/EnlighterJS.min.css?ver=3.10.0' type='text/css' media='all' /> <!--n2css--><script type='text/javascript' src='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-includes/js/jquery/jquery.js?ver=1.12.4-wp'></script> <script type='text/javascript' src='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1'></script> <!--[if lt IE 9]> <script type='text/javascript' src='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/themes/twentyseventeen/assets/js/html5.js?ver=3.7.3'></script> <![endif]--> <link rel='https://api.w.org/' href='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-json/' /> <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://rpcnufrlkr.cluster006.ovh.net/olga/xmlrpc.php?rsd" /> <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://rpcnufrlkr.cluster006.ovh.net/olga/wp-includes/wlwmanifest.xml" /> <meta name="generator" content="WordPress 5.2.13" /> <link rel='shortlink' href='http://rpcnufrlkr.cluster006.ovh.net/olga/?p=1697' /> <link rel="alternate" type="application/json+oembed" href="http://rpcnufrlkr.cluster006.ovh.net/olga/wp-json/oembed/1.0/embed?url=http%3A%2F%2Frpcnufrlkr.cluster006.ovh.net%2Folga%2Fles-chaines-de-caracteres-et-les-types-construits-en-python%2F" /> <link rel="alternate" type="text/xml+oembed" href="http://rpcnufrlkr.cluster006.ovh.net/olga/wp-json/oembed/1.0/embed?url=http%3A%2F%2Frpcnufrlkr.cluster006.ovh.net%2Folga%2Fles-chaines-de-caracteres-et-les-types-construits-en-python%2F&format=xml" /> <style type="text/css" id="syntaxhighlighteranchor"></style> <link rel="icon" href="http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/uploads/2017/11/laptop_chromebook.png" sizes="32x32" /> <link rel="icon" href="http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/uploads/2017/11/laptop_chromebook.png" sizes="192x192" /> <link rel="apple-touch-icon-precomposed" href="http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/uploads/2017/11/laptop_chromebook.png" /> <meta name="msapplication-TileImage" content="http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/uploads/2017/11/laptop_chromebook.png" /> <!-- BEGIN ExactMetrics v5.3.8 Universal Analytics - https://exactmetrics.com/ --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-110556889-1', 'auto'); ga('send', 'pageview'); </script> <!-- END ExactMetrics Universal Analytics --> <style type="text/css" id="wp-custom-css"> /* Vous pouvez ajouter du CSS personnalisé ici. Cliquez sur l’icône d’aide ci-dessus pour en savoir plus. */ </style> </head> <body class="page-template-default page page-id-1697 has-header-image page-one-column colors-light"> <div id="page" class="site"> <a class="skip-link screen-reader-text" href="#content">Aller au contenu principal</a> <header id="masthead" class="site-header" role="banner"> <div class="custom-header"> <div class="custom-header-media"> <div id="wp-custom-header" class="wp-custom-header"><img src="http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/uploads/2018/03/cropped-steam-3160715.jpg" width="2000" height="1199" alt="Informatique & Mathématiques" srcset="http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/uploads/2018/03/cropped-steam-3160715.jpg 2000w, http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/uploads/2018/03/cropped-steam-3160715-300x180.jpg 300w, http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/uploads/2018/03/cropped-steam-3160715-768x460.jpg 768w, http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/uploads/2018/03/cropped-steam-3160715-1024x614.jpg 1024w" sizes="100vw" /></div> </div> <div class="site-branding"> <div class="wrap"> <div class="site-branding-text"> <p class="site-title"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/" rel="home">Informatique & Mathématiques</a></p> <p class="site-description">Olga Samy Modeliar</p> </div><!-- .site-branding-text --> </div><!-- .wrap --> </div><!-- .site-branding --> </div><!-- .custom-header --> <div class="navigation-top"> <div class="wrap"> <nav id="site-navigation" class="main-navigation" role="navigation" aria-label="Menu supérieur"> <button class="menu-toggle" aria-controls="top-menu" aria-expanded="false"> Menu </button> <div class="menu-mon-menu-container"><ul id="top-menu" class="menu"><li id="menu-item-46" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-46"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/informatique-au-lycee/">Accueil</a></li> <li id="menu-item-1464" class="menu-item menu-item-type-post_type menu-item-object-post current-menu-ancestor menu-item-has-children menu-item-1464"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/2019/08/04/nsi-numerique-sciences-informatiques/">NSI Première</a> <ul class="sub-menu"> <li id="menu-item-1921" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1921"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/presentation-de-la-specialite-nsi/">Présentation de la spécialité NSI</a></li> <li id="menu-item-1652" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1652"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/redemarrer-avec-python/">Redémarrer avec Python</a></li> <li id="menu-item-1408" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1408"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/compteur-binaire/">Représentation binaire d’un entier positif</a></li> <li id="menu-item-1559" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1559"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/representation-binaire-dun-entier-relatif/">Représentation binaire d’un entier relatif</a></li> <li id="menu-item-1438" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1438"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/nombre-flottant/">Représentation binaire d’un nombre réel</a></li> <li id="menu-item-1453" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1453"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/representation-hexadecimale-dun-entier-positif/">Représentation hexadécimale d’un entier positif</a></li> <li id="menu-item-1358" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1358"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/tris/">Tris</a></li> <li id="menu-item-2072" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-ancestor current-menu-parent current_page_parent current_page_ancestor menu-item-has-children menu-item-2072"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/fiches-de-revisions-nsi/">Révisions NSI première</a> <ul class="sub-menu"> <li id="menu-item-1984" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1984"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/representation-des-entiers-naturels/">Fiche de révision 1 T1: Représentation des entiers naturels</a></li> <li id="menu-item-2015" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2015"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/representation-des-entiers-relatifs/">Fiche de révision 2 T1: Représentation des entiers relatifs</a></li> <li id="menu-item-2031" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2031"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/fiche-de-revision-3-t1-representation-des-reels/">Fiche de révision 3 T1: Représentation des réels</a></li> <li id="menu-item-2041" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2041"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/fiche-de-revision-4-t1-booleens/">Fiche de révision 4 T1: Booléens</a></li> <li id="menu-item-2058" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2058"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/fiche-de-revision-5-t1-chaines-de-caracteres/">Fiche de révision 5 T1: Chaînes de caractères</a></li> <li id="menu-item-1905" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-1697 current_page_item menu-item-1905"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/les-chaines-de-caracteres-et-les-types-construits-en-python/" aria-current="page">Fiche de révision 1 T2 : Types construits en Python</a></li> <li id="menu-item-2107" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2107"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/fiche-de-revision-interaction-homme-machine-sur-le-web/">Fiche de révision 1 T3: Interaction entre l’homme et la machine sur le Web.</a></li> <li id="menu-item-2095" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2095"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/fiche-de-revision-1-t5-architecture-de-von-neumann/">Fiche de révision 1 T5: Architecture de Von Neumann</a></li> <li id="menu-item-2164" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2164"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/fiche-de-revision-3-t5-systemes-dexploitation/">Fiche de révision 3 T5: Systèmes d’exploitation</a></li> <li id="menu-item-2163" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2163"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/fiche-de-revision-4-t5-terminal/">Fiche de révision 4 T5: Terminal</a></li> <li id="menu-item-2073" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2073"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/python-instructions-de-base/">Fiche de révision 1 T6 : Python, instructions de base</a></li> <li id="menu-item-2131" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2131"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/fiche-de-revision-1-t7-algorithmes-de-tris/">Fiche de révision 1 T7 : Algorithmes de tris</a></li> <li id="menu-item-1678" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1678"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/lexique-de-programmation/">Lexique de programmation</a></li> </ul> </li> </ul> </li> <li id="menu-item-2185" class="menu-item menu-item-type-post_type menu-item-object-post menu-item-2185"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/2020/07/28/nsi-terminale/">NSI Terminale</a></li> <li id="menu-item-2191" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2191"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/snt/">SNT</a></li> <li id="menu-item-139" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-139"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/category/images/">Images</a> <ul class="sub-menu"> <li id="menu-item-1208" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1208"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/couleurs/">Couleurs</a></li> <li id="menu-item-140" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-140"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/category/images/gimp/">Gimp</a> <ul class="sub-menu"> <li id="menu-item-344" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-344"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/gimp-1/">Gimp 1</a></li> <li id="menu-item-1025" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1025"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/calque-gimp/">Gimp 2 : Calque.</a></li> <li id="menu-item-353" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-353"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/gimp-3/">Gimp 3 : Masques. Couleur des yeux.</a></li> <li id="menu-item-1079" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1079"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/gimp-4-masques-creer-effet-de-dispersion/">Gimp 4 : Masques. Créer un effet de dispersion.</a></li> </ul> </li> <li id="menu-item-141" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-141"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/category/images/inkscape/">Inkscape</a> <ul class="sub-menu"> <li id="menu-item-1268" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1268"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/inkscape-tuto-1-bases/">Inkscape Tuto 1. Les bases.</a></li> <li id="menu-item-953" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-953"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/animation-dimages-vectorielles/">Animation d’images vectorielles</a></li> </ul> </li> </ul> </li> <li id="menu-item-331" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-331"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/processing/">Processing</a> <ul class="sub-menu"> <li id="menu-item-43" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-43"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/processing-tp-1/">Niveau 1</a></li> <li id="menu-item-575" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-575"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/processing-niveau-1-synthese/">Synthèse niveau 1</a></li> <li id="menu-item-589" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-589"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/mini-projet-noel/">Mini-Projet Noël</a></li> <li id="menu-item-805" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-805"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/processing-niveau-2-transformations-et-fractales/">Processing – Niveau 2-Fractales et transformations</a></li> <li id="menu-item-825" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-825"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/processing-niveau2-simulation-automates-cellulaires/">Processing-Niveau2-Simulation-Automates cellulaires</a></li> </ul> </li> <li id="menu-item-144" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-144"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/category/python/">Python</a> <ul class="sub-menu"> <li id="menu-item-1693" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1693"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/python-apercu-rapide/">Python : Aperçu rapide.</a></li> <li id="menu-item-532" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-532"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/python-niveau-1/">Python Niveau 1</a></li> <li id="menu-item-541" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-541"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/python-turtle-1/">Python Turtle Tuto 1</a></li> <li id="menu-item-642" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-642"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/python-turtle-2/">Python Turtle 2 Boucles</a></li> <li id="menu-item-732" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-732"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/python-turtle-3-tests-boucle-conditionnelle/">Python turtle 3. Tests et boucles conditionnelles.</a></li> <li id="menu-item-747" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-747"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/python-turtle4-fonctions/">Python Turtle4 : Fonctions</a></li> <li id="menu-item-762" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-762"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/turtle-5-evenements-premier-jeu/">Turtle 5 : Evenements. Premier jeu !</a></li> </ul> </li> <li id="menu-item-1413" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1413"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/contact-2/">Contact</a></li> <li id="menu-item-2195" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-2195"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/category/mathematiques/seconde/">Seconde</a> <ul class="sub-menu"> <li id="menu-item-2196" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2196"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/programmation-1/">Programmation 1</a></li> <li id="menu-item-2197" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2197"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/programmation-1-variables-et-instructions/">Programmation 1 : Variables et affectations.</a></li> <li id="menu-item-2198" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2198"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/programmation-1-tp/">Programmation 1 TP</a></li> <li id="menu-item-2199" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2199"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/programmation-2-instructions-conditionnelles/">Programmation 2 : Instructions conditionnelles</a></li> <li id="menu-item-2200" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2200"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/tests-en-python/">Programmation 2 : Tests en Python</a></li> <li id="menu-item-2201" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2201"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/programmation-2-tp-instructions-conditionnelles/">Programmation 2 TP Tests Instructions conditionnelles.</a></li> <li id="menu-item-2202" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2202"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/boucles/">Programmation 3 : Boucles. Cours</a></li> <li id="menu-item-2203" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2203"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/programmation-3-boucles/">Programmation 3 Boucles</a></li> <li id="menu-item-2204" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2204"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/programmation-3-boucles-tp/">Programmation 3 Boucles : TP</a></li> <li id="menu-item-2205" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2205"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/fonctions-en-python/">Programmation 4 : Fonctions en Python</a></li> <li id="menu-item-2206" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2206"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/fonctions-en-python-2/">Programmation 4 : Fonctions en Python. Cours</a></li> </ul> </li> <li id="menu-item-2229" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2229"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/echantillonnage-1/">Échantillonnage 1</a></li> <li id="menu-item-2230" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2230"><a href="http://rpcnufrlkr.cluster006.ovh.net/olga/echantillonnage-2/">Échantillonnage 2</a></li> </ul></div> </nav><!-- #site-navigation --> </div><!-- .wrap --> </div><!-- .navigation-top --> </header><!-- #masthead --> <div class="site-content-contain"> <div id="content" class="site-content"> <div class="wrap"> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <article id="post-1697" class="post-1697 page type-page status-publish hentry"> <header class="entry-header"> <h1 class="entry-title">Les chaines de caractères et les types construits en Python</h1> </header><!-- .entry-header --> <div class="entry-content"> <p> </p> <table style="height: 844px; width: 150%; border-collapse: collapse; background-color: #ffffff; border-style: solid; border-color: #000000;"> <thead> <tr style="height: 21px;"> <th style="height: 21px; width: 16.2853%;" scope="col"> </th> <td style="height: 21px; width: 23.5715%;"> <div class="standard"><span style="color: #263082; background-color: #ffffff;"><strong>Chaînes</strong></span></div> </td> <td style="height: 21px; width: 19%;"><span style="color: #263082; background-color: #ffffff;"><strong>Tuples</strong></span></td> <td style="height: 21px; width: 20%;"><span style="color: #263082; background-color: #ffffff;"><strong>Listes</strong></span></td> <td style="height: 21px; width: 15.6595%;"><span style="color: #263082; background-color: #ffffff;"><strong>Dictionnaires</strong></span></td> </tr> </thead> <tbody> <tr style="height: 21px;"> <th style="height: 21px; width: 16.2853%;" scope="col"><strong><span style="color: #800000;">Type</span></strong></th> <td style="width: 23.5715%; height: 21px;">Str</td> <td style="width: 15.2926%; height: 21px;">Tuple</td> <td style="width: 20.0691%; height: 21px;">List</td> <td style="width: 15.6595%; height: 21px;">Dict</td> </tr> <tr style="height: 21px;"> <th style="height: 21px; width: 16.2853%;" scope="col"><span style="color: #800000;"><strong>Création</strong></span></th> <td style="width: 23.5715%; height: 21px;"> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">s="abc"</code></pre> </td> <td style="width: 15.2926%; height: 21px;"> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">t=("a","b",5)</code></pre> </td> <td style="width: 20.0691%; height: 21px;"> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">l=["a","b",5]</code></pre> </td> <td style="width: 19%; height: 21px;"> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">d={"cle1":"a","cle2":"b"}</code></pre> <br />Les clés peuvent être de<br />type int, float, str ou<br />tuples non mutables</td> </tr> <tr style="height: 21px;"> <td style="width: 16.2853%; height: 21px;"><span style="color: #800000;"><strong>Longueur</strong></span></td> <td style="width: 23.5715%; height: 21px;"> <pre><pre data-enlighter-language="python" class="EnlighterJSRAW">len(s) </pre></pre> </td> <td style="width: 15.2926%; height: 21px;"> <pre><pre data-enlighter-language="python" class="EnlighterJSRAW">len(t) </pre></pre> </td> <td style="width: 20%; height: 21px;"> <pre><pre data-enlighter-language="python" class="EnlighterJSRAW">len(l) </pre></pre> </td> <td style="width: 19%; height: 21px;"> <pre><pre data-enlighter-language="python" class="EnlighterJSRAW">len(d) </pre></pre> </td> </tr> <tr style="height: 21px;"> <td style="width: 16.2853%; height: 84px;" rowspan="4"><strong><span style="color: #800000;">Valeur</span></strong> </td> <td style="width: 23.5715%; height: 21px;"> <p>d’indice i</p> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">s[i]</code></pre> </td> <td style="width: 15.2926%; height: 21px;"> <p>d’indice i</p> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">t[i]</code></pre> </td> <td style="width: 20%; height: 21px;"> <p>d’indice i</p> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">l[i]</code></pre> </td> <td style="width: 15.6595%; height: 21px;"> <p>associée à une clé</p> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">d["cle1"]</code></pre> </td> </tr> <tr style="height: 21px;"> <td style="width: 23.5715%; height: 21px;"> <p>d’indice i à j-1</p> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">s[i:j]</code></pre> </td> <td style="width: 15.2926%; height: 21px;"> <p>d’indice i à j-1</p> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">t[i:j]</code></pre> </td> <td style="width: 20%; height: 21px;"> <p>d’indice i à j-1</p> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">l[i:j]</code></pre> </td> <td style="width: 15.6595%; height: 21px;"> </td> </tr> <tr style="height: 21px;"> <td style="width: 23.5715%; height: 21px;"> <p>à partir de l’indice i</p> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">s[i:]</code></pre> </td> <td style="width: 15.2926%; height: 21px;"> <p>à partir de l’indice i</p> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">t[i:]</code></pre> </td> <td style="width: 20.0691%; height: 21px;"> <p>à partir de l’indice i</p> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">l[i:]</code></pre> </td> <td style="width: 15.6595%; height: 21px;"> </td> </tr> <tr style="height: 21px;"> <td style="width: 23.5715%; height: 21px;"> <p>jusqu’à l’indice j-1</p> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">s[:j]</code></pre> </td> <td style="width: 15.2926%; height: 21px;"> <p>jusqu’à l’indice j-1</p> <pre><code data-enlighter-language="python" class="EnlighterJSRAW"> t[:j]</code></pre> </td> <td style="width: 20.0691%; height: 21px;"> <p>jusqu’à l’indice j-1</p> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">l[:j]</code></pre> </td> <td> </td> </tr> <tr style="height: 21px;"> <td style="width: 16.2853%; height: 21px;"><strong><span style="color: #800000;">Concaténation</span></strong></td> <td style="width: 23.5715%; height: 21px;"> <pre><pre data-enlighter-language="python" class="EnlighterJSRAW">"ab"+"c" </pre></pre> </td> <td style="width: 15.2926%; height: 21px;"> <pre><pre data-enlighter-language="python" class="EnlighterJSRAW">t=("a","b")+("c",) </pre></pre> </td> <td style="width: 20.0691%; height: 21px;"> <pre><pre data-enlighter-language="python" class="EnlighterJSRAW">[";a","b"]+["c"] </pre></pre> </td> <td> </td> </tr> <tr style="height: 88px;"> <td style="width: 16.2853%; height: 88px;"><strong><span style="color: #800000;">Ajout d’un<br />élément</span></strong></td> <td style="width: 23.5715%; height: 88px;"> <p><strong>Non mutable</strong></p> </td> <td style="width: 15.2926%; height: 88px;"><strong>Non mutable</strong></td> <td style="width: 20.0691%; height: 88px;"> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">l.append("d")</code></pre> </td> <td style="width: 15.6595%; height: 88px;"> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">d["cle3"]="c"</code></pre> </td> </tr> <tr style="height: 137px;"> <td style="width: 16.2853%; height: 137px;"><strong><span style="color: #800000;">Suppression <br />d’un élément</span></strong></td> <td style="width: 23.5715%; height: 137px;"> <p><strong>Non mutable</strong></p> </td> <td style="width: 15.2926%; height: 137px;"><strong>Non mutable</strong></td> <td style="width: 20.0691%; height: 137px;"> <p>d’indice i</p</p> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">l.pop(i) </code></pre> </td> <td style="width: 15.6595%; height: 137px;">de clé donnée <pre><code data-enlighter-language="python" class="EnlighterJSRAW">d.pop("cle1")</code></pre> <br />ou<br /> <pre><code data-enlighter-language="python" class="EnlighterJSRAW">del d["cle1"] </code></pre> </td> </tr> <tr style="height: 150px;"> <td style="width: 16.2853%; height: 150px;" rowspan="3"><strong><span style="color: #800000;">Parcours</span></strong></td> <td style="width: 23.5715%; height: 150px;"> <p>Avec l’indice</p> <pre><pre data-enlighter-language="python" class="EnlighterJSRAW">for i in range(len(s)): print(s[i]) </pre></pre> </td> <td style="width: 15.2926%; height: 150px;"> <p>Avec l’indice</p> <pre><pre data-enlighter-language="python" class="EnlighterJSRAW">for i in range(len(t)): print(t[i]) </pre></pre> </td> <td style="width: 20.0691%; height: 150px;"> <p>Avec l’indice</p> <pre><pre data-enlighter-language="python" class="EnlighterJSRAW">for i in range(len(l)): print(l[i]) </pre></pre> </td> <td style="width: 15.6595%; height: 150px;"> <p>Parcours des clés</p> <pre><pre data-enlighter-language="python" class="EnlighterJSRAW">for cle in d: print(cle) </pre></pre> </td> </tr> <tr style="height: 150px;"> <td style="width: 23.5715%; height: 150px;"> <p>Directement</p> <pre><pre data-enlighter-language="python" class="EnlighterJSRAW">for x in s: print(x) </pre></pre> </td> <td style="width: 15.2926%; height: 150px;"> <p>Directement</p> <pre><pre data-enlighter-language="python" class="EnlighterJSRAW">for x in t: print(x) </pre></pre> </td> <td style="width: 20.0691%; height: 150px;"> <p>Directement</p> <pre><pre data-enlighter-language="python" class="EnlighterJSRAW">for x in l: print(x) </pre></pre> </td> <td style="width: 15.6595%; height: 150px;"> <p>Parcours des valeurs</p> <pre><pre data-enlighter-language="python" class="EnlighterJSRAW">for val in d.values(): print(val) </pre></pre> </td> </tr> <tr style="height: 150px;"> <td style="width: 23.5715%; height: 150px;"> </td> <td style="width: 15.2926%; height: 150px;"> </td> <td style="width: 20.0691%; height: 150px;"> </td> <td style="width: 15.6595%; height: 150px;"> <p>Parcours des clés et valeurs</p> <pre><pre data-enlighter-language="python" class="EnlighterJSRAW">for cle,val in d.items(): print(cle,val) </pre></pre> </td> </tr> </tbody> </table> <p> </p> </div><!-- .entry-content --> </article><!-- #post-## --> </main><!-- #main --> </div><!-- #primary --> </div><!-- .wrap --> </div><!-- #content --> <footer id="colophon" class="site-footer" role="contentinfo"> <div class="wrap"> <aside class="widget-area" role="complementary" aria-label="Pied de page"> <div class="widget-column footer-widget-2"> <section id="text-4" class="widget widget_text"> <div class="textwidget"><p><strong>Adresse</strong><br /> Lycée Madeleine Michelis</p> <p><span class="_Xbe">43 Rue des Otages,</span></p> <p><span class="_Xbe"> 80000 Amiens</span></p> <p><b>Site Web</b></p> <p><a href="http://michelis.lyc.ac-amiens.fr/">http://michelis.lyc.ac-amiens.fr/</a></p> </div> </section> </div> </aside><!-- .widget-area --> <div class="site-info"> <a href="https://wordpress.org/" class="imprint"> Fièrement propulsé par WordPress </a> </div><!-- .site-info --> </div><!-- .wrap --> </footer><!-- #colophon --> </div><!-- .site-content-contain --> </div><!-- #page --> <script type='text/javascript'> /* <![CDATA[ */ var wpcf7 = {"apiSettings":{"root":"http:\/\/rpcnufrlkr.cluster006.ovh.net\/olga\/wp-json\/contact-form-7\/v1","namespace":"contact-form-7\/v1"}}; /* ]]> */ </script> <script type='text/javascript' src='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/plugins/contact-form-7/includes/js/scripts.js?ver=5.1.4'></script> <script type='text/javascript' src='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/plugins/dk-pdf/assets/js/frontend.js?ver=1.9.6'></script> <script type='text/javascript'> /* <![CDATA[ */ var twentyseventeenScreenReaderText = {"quote":""}; /* ]]> */ </script> <script type='text/javascript' src='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/themes/twentyseventeen/assets/js/skip-link-focus-fix.js?ver=1.0'></script> <script type='text/javascript' src='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/themes/twentyseventeen/assets/js/navigation.js?ver=1.0'></script> <script type='text/javascript' src='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/themes/twentyseventeen/assets/js/global.js?ver=1.0'></script> <script type='text/javascript' src='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/themes/twentyseventeen/assets/js/jquery.scrollTo.js?ver=2.1.2'></script> <script type='text/javascript' src='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/plugins/enlighter/resources/mootools-core-yc.js?ver=3.10.0'></script> <script type='text/javascript' src='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-content/plugins/enlighter/resources/EnlighterJS.min.js?ver=3.10.0'></script> <script type='text/javascript' src='http://rpcnufrlkr.cluster006.ovh.net/olga/wp-includes/js/wp-embed.min.js?ver=5.2.13'></script> <script type="text/javascript">/* <![CDATA[ */EnlighterJS_Config = {"selector":{"block":"pre.EnlighterJSRAW","inline":"code.EnlighterJSRAW"},"language":"generic","theme":"enlighter","indent":2,"hover":"hoverEnabled","showLinenumbers":false,"rawButton":true,"infoButton":true,"windowButton":true,"rawcodeDoubleclick":false,"grouping":true,"cryptex":{"enabled":false,"email":"mail@example.tld"}};!function(){var a=function(a){var b="Enlighter Error: ";console.error?console.error(b+a):console.log&&console.log(b+a)};return window.addEvent?"undefined"==typeof EnlighterJS?void a("Javascript Resources not loaded yet!"):"undefined"==typeof EnlighterJS_Config?void a("Configuration not loaded yet!"):void window.addEvent("domready",function(){EnlighterJS.Util.Init(EnlighterJS_Config.selector.block,EnlighterJS_Config.selector.inline,EnlighterJS_Config)}):void a("MooTools Framework not loaded yet!")}();;/* ]]> */</script> </body> </html>