tp9_2de.py

Created by jean-luc-poncin

Created on December 16, 2021

376 Bytes

Boucle Tant que


# Exercice 9.1
# Questions 1, 2, 3, 4

def popu1():
  p=20000
  c=0
  while(p<23000):
    p=p*1.03
    c=c+1
  return(c)

# Exercice 9.1
# Questions 5, 6 et 7

def popu2(s):
  p=20000
  c=0
  while(p<s):
    p=p*1.03
    c=c+1
  return(c)
  
# Exercice 9.2

def f(x):
  return(x**2-10*x+18)
  
def sol():
  x=7
  while(f(x)<0):
    x=x+0.01
  return([x-0.01,x])