fiche1pyth
DownloadTélécharger
Actions
Vote :
ScreenshotAperçu

Informations
Catégorie :Category: nCreator TI-Nspire
Auteur Author: superkepo28
Type : Classeur 3.0.1
Page(s) : 1
Taille Size: 2.67 Ko KB
Mis en ligne Uploaded: 29/04/2025 - 14:42:57
Uploadeur Uploader: superkepo28 (Profil)
Téléchargements Downloads: 1
Visibilité Visibility: Archive publique
Shortlink : http://ti-pla.net/a4610284
Type : Classeur 3.0.1
Page(s) : 1
Taille Size: 2.67 Ko KB
Mis en ligne Uploaded: 29/04/2025 - 14:42:57
Uploadeur Uploader: superkepo28 (Profil)
Téléchargements Downloads: 1
Visibilité Visibility: Archive publique
Shortlink : http://ti-pla.net/a4610284
Description
Fichier Nspire généré sur TI-Planet.org.
Compatible OS 3.0 et ultérieurs.
<<
=9 TYPES DE DONNÉES int 5, -2, 0float 3.14, -0.1str "Bonjour"bool True / False =9 CONVERSIONS int("3") 3float("2.5") 2.5str(42) "42"bool(0) False =9 OPÉRATEURS + - * / classiques// % ** entier, modulo, puissance== != > < >= <= comparaisonsand or not logiques =9 STRUCTURES DE CONTRÔLE if a > 0: ...elif a == 0: ...else: ...while condition: ...for i in range(n): ... =9 FONCTIONS DE BASE def nom(param): return valeurdef f(x=2): return x*2f(3) 6f() 4 =9 RETOUR MULTIPLE def infos(): return "Azar", 20nom, age = infos() =9 STRUCTURES DE DONNÉES LISTES [ ] l = [1, 2, 3]l.append(4) ajoute finl.insert(1, 9) insère à pos 1l.pop() retire finl.remove(2) retire par valeur TUPLES ( ) t = (1, 2, 3)t[0] = 5 erreur (immuable) DICTIONNAIRES { } d = {"nom": "Azar", "age": 20}d["ville"] = "Agadir"d.get("email") None ENSEMBLES set() s = {1, 2, 2, 3} {1, 2, 3}s.add(4)s.remove(2) erreur si absents.discard(2) ok même si absent =9 COMPRÉHENSIONS Liste : [x for x in range(5)][x for x in l if x > 0] Dictionnaire : {x: x**2 for x in range(3)} Set : {x for x in range(5) if x%2==0} =9 MÉTHODES UTILES list(str) ['a','b']dict.items() liste (clé,valeur)range(a,b,s) boucle pas à passum([1,2,3]) 6len(obj) taille =9 PIÈGES À ÉVITER input() retourne str"False" bool("False") == True(5) int ` (5,) tupleremove() erreur si absentdiscard() aucun risqueset() pas dindex{} dict vide, pas un set =é EXEMPLES RAPIDES # Fonction simpledef f(x): return x*x# Compréhension :[x for x in range(4) if x%2==0]# Ajout dictionnaired = {"x":1}d["y"] = 2# Ensemble{1,2,2,3} {1,2,3} Made with nCreator - tiplanet.org
>>
Compatible OS 3.0 et ultérieurs.
<<
=9 TYPES DE DONNÉES int 5, -2, 0float 3.14, -0.1str "Bonjour"bool True / False =9 CONVERSIONS int("3") 3float("2.5") 2.5str(42) "42"bool(0) False =9 OPÉRATEURS + - * / classiques// % ** entier, modulo, puissance== != > < >= <= comparaisonsand or not logiques =9 STRUCTURES DE CONTRÔLE if a > 0: ...elif a == 0: ...else: ...while condition: ...for i in range(n): ... =9 FONCTIONS DE BASE def nom(param): return valeurdef f(x=2): return x*2f(3) 6f() 4 =9 RETOUR MULTIPLE def infos(): return "Azar", 20nom, age = infos() =9 STRUCTURES DE DONNÉES LISTES [ ] l = [1, 2, 3]l.append(4) ajoute finl.insert(1, 9) insère à pos 1l.pop() retire finl.remove(2) retire par valeur TUPLES ( ) t = (1, 2, 3)t[0] = 5 erreur (immuable) DICTIONNAIRES { } d = {"nom": "Azar", "age": 20}d["ville"] = "Agadir"d.get("email") None ENSEMBLES set() s = {1, 2, 2, 3} {1, 2, 3}s.add(4)s.remove(2) erreur si absents.discard(2) ok même si absent =9 COMPRÉHENSIONS Liste : [x for x in range(5)][x for x in l if x > 0] Dictionnaire : {x: x**2 for x in range(3)} Set : {x for x in range(5) if x%2==0} =9 MÉTHODES UTILES list(str) ['a','b']dict.items() liste (clé,valeur)range(a,b,s) boucle pas à passum([1,2,3]) 6len(obj) taille =9 PIÈGES À ÉVITER input() retourne str"False" bool("False") == True(5) int ` (5,) tupleremove() erreur si absentdiscard() aucun risqueset() pas dindex{} dict vide, pas un set =é EXEMPLES RAPIDES # Fonction simpledef f(x): return x*x# Compréhension :[x for x in range(4) if x%2==0]# Ajout dictionnaired = {"x":1}d["y"] = 2# Ensemble{1,2,2,3} {1,2,3} Made with nCreator - tiplanet.org
>>