def nb_amis(L, m, s): pos_s = ... if pos_s == None: return ... amis = 0 for i in range(len(m)): amis += ... return ...