jeudi 10 décembre 2020

problem with sorting and number generation in python 3

I wrote a program for generating and sorting numbers, but it does not work after firing, nothing is displayed, I also wanted these numbers to sort and also does not work. I drank 3 coffee and then nothing.

import random
mylist = []
for i in range(0,5):
  x = random.randint(1,50)
  mylist.append(x)
  mylist.sort()

I tried to give mylist.sort () functions in different places, I tried without it and then nothing.

I am just learning and maybe this problem is not difficult but at the beginning of my career everything is complicated.




Aucun commentaire:

Enregistrer un commentaire