tdn5.py

Created by emiledu90

Created on March 29, 2023

555 Bytes


i=0
S=1
while S<=12345:
    i=i+1
    S=S+i
    print(i,S)

#Se concentrer sur la manière de calculer une somme

#Exercice 1 3)
i=0
S=1
while S<=12345:
    i=i+1
    S=S+(i*i)
    print(i,S)

#Exercice 1 4)
U=1
n=0
while U >=10**(-4):
    n=n+1
    U=(0.7)**(3*n)
    print (n,U)

#Exercice 1 5)
n=int((input("Donne moi un nombre")))
i=0
while 2**i<=n:
    i=i+1
    print("pour i=",i,"2**",i,"=",2**i)

#Exercice 1 6)
n=int((input("Donne moi un nombre")))
d=2
while n%d!=0:
    d=d+1
print(d)

#Exercice 2
#factorielle se note n!
3!=1*2*3=6

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.