def add_mul(a,b):
    somme = a+b
    produit = a*b
    return somme, produit


somme,produit = add_mul(8,5)
print("Resultat: %d et %d" %(somme, produit) )


class toto:
     x = 23 #attribut


a = toto()    # a est un objet de la classe toto (ou une instance)
a.x           # affiche la valeur de l'attribut a
toto.z = 6    # ajouter un nouvel attribut
a.lolo = 125  # ajouter un nouvel attribut



class C: # x et y : attributs de classe
    x = 23
    y = x + 5
    def affiche(self): # méthode affiche()
        self.z = 42 # attribut d'instance
        print(C.y) # dans une méthode, on qualifie un attribut de classe,
        print(self.z) # mais pas un attribut d'instance

obj = C() # instanciation de l'objet obj
obj.affiche()

