from random import random from math import ceil def uniforme_discrete(k): U=random() X=ceil(k*U) return X