sommesansfin.py

Created by cent20

Created on June 10, 2023

155 Bytes

SNT 🐍 Programmation Boucles non bornées


# Une boucle infinie
somme = 0
nb = 0
while somme > -1:
    somme = somme + nb
    nb = nb + 1
    print(0, "+ ... +", nb, "=", somme)