vendredi 15 septembre 2017

How to use numbers from a list as argument in random.randint(x, y) python

x = random.randint(1, 100) y = random.randint(1, 100)

myList = [x, y] newNumber = random.randint(x, y)

but when...

myList = [(nsmallest(2, guesses, key=lambda x: abs(x-number)))]

I don't know what the numbers are, and how to use them as arguments (x, y) to determine the newNumber




Aucun commentaire:

Enregistrer un commentaire