this = 'is a code block' from pylab import linspace from pylab import * 1+1 for x in range(3): print x x = 1 x = 2 1+1 for x in range(3): print x 1+1 2+2 3+3 1+1 1+1 1+1 def plus_grand_element(liste): """ Renvoie le plus grand élément de la liste EXAMPLES:: sage: plus_grand_element([7,3,1,10,4,10,2,9]) 10 sage: plus_grand_element([7]) 7 """ resultat = liste[0] for i in range(1, len(liste)-1): # Invariant: resultat est le plus grand element de liste[:i] assert resultat in liste[:i] assert all(resultat >= x for x in liste[:i]) if liste[i] > resultat: resultat = liste[i] return resultat plus_grand_element([7,3,1,10,4,10,2,9]) 1+1 1+1