# -*- coding:utf-8 -*- __projet__ = "CoursS5" __nom_fichier__ = "suiterecurrente" __author__ = "A-J. Tinet" __date__ = "octobre 2022" """ ======================================================================================================================== Ex 13. SUITE RECURRENTE ======================================================================================================================== """ # Programme principal if __name__ == '__main__': x = float(input("Choisir un nombre x : ")) n = int(input("Choisir un entier positif n : ")) # Initialisation u = 1 # Cas impossible (x = 0) if x == 0: print("Cas impossible.") else: for _ in range(n): u = -2*u/x print("Enième terme de la suite = ",u)