mercredi 29 juillet 2020

How to create a function to generate 15 random integers between 1 to 99 in python3? [duplicate]

Here's my code:

from random import randint as r_int

 def random_int_15():
    r_num = 0
    for i in range(0, 15):
        r_num = r_int(1, 99)
    return r_num

I want to use this function in some other function and I don't want any no. to be repeated. I know there is a way to do it, I don't find any. Help me.




Aucun commentaire:

Enregistrer un commentaire