﻿# focntions
def continuer():
    rep = input("Voulez-vous continuer la saisie de notes ? Si oui, saisir O, sinon saisir N.")
    rep = rep.upper()
    if rep == "O":
        bool = True
    else:
        bool = False
    return bool

def moyenne(moy,nb_notes,new_note):
    new_moy = (moy * nb_notes + new_note)/(nb_notes + 1)
    return new_moy

# programme principal
def main():
    moy = 0
    nb_notes = 0
    bool = True
    while bool == True:
        new_note = float(input("Saisir la nouvelle note :"))
        moy = moyenne(moy,nb_notes,new_note)
        nb_notes = nb_notes + 1
        bool = continuer()
    return moy