lundi 14 mars 2022

How can I sort the random generated number in order from smallest to greatest? [closed]

How can I sort the random generated numbers in order from smallest to greatest? My code is not working.

# generate 6 random integer values
from random import randint

number1 = randint(1, 69)
number2 = randint(1, 69)
number3 = randint(1, 69)
number4 = randint(1, 69)
number5 = randint(1, 69)
number6 = randint(1,25)
ListA = [number1,number2,number3,number4,number5]
print sorted(ListA, reverse=True)



Aucun commentaire:

Enregistrer un commentaire