x = 10 # intnom = "Alice" # strpi = 3.14 # floatactif = True # booltype(x) # <class 'int'>str(10) # '10' : entier -> texteint("10") # 10 : texte -> entierfloat("3.14") # 3.14 : texte -> decimalif condition: ...elif autre: ...else: ...match valeur: case 1: ... case _: ... 'else'for i in range(5): print(i)while condition: ... break continuedef ma_fonction(a, b=10): return a + bresultat = ma_fonction(3)carre = lambda x: x**2liste = [1, 2, 3]liste.append(4)liste[0] # 1er elementliste[-1] # dernierliste[1:3] # slicingcarres = [x**2 for x in range(5)]d = {"cle": "valeur", "age": 25}d["cle"]d["nouvelle_cle"] = 1for cle, valeur in d.items(): print(cle, valeur)nom = "Alice"msg = f"Bonjour {nom} !"texte.strip()texte.split(",")texte.upper()texte.lower()print("Resultat :", valeur)age = input("Ton age : ")age = int(age)print(f"Tu as {age} ans")try: x = 10 / 0except ZeroDivisionError: print("Erreur !")else: print("OK")finally: print("Fin")with open("data.txt", "r") as f: contenu = f.read()with open("out.txt", "w") as f: f.write("Bonjour")class Chien: def __init__(self, nom): self.nom = nom def aboyer(self): print(f"{self.nom} : Wouf")rex = Chien("Rex")== != < > <= >=and or notin isx += 1 # x = x + 1x -= 1 # x = x - 1import mathfrom math import sqrtimport numpy as npmath.sqrt(16)sqrt(16)