lundi 9 janvier 2017

Display the max and min values of a random generated list of ten numbers [duplicate]

This question already has an answer here:

I am very new to Python and have an exercise to generate a list of ten random numbers

import random
Numbers=[]
for i in range (10):
    Numbers=random.randint(1,101)
    print(Numbers)

So far easy enough, now I have to display the maximum and minimum without using the built in max and min functions but have no idea how to go about doing this. To be honest I have no idea how to go about this with or without the max, min functions!




Aucun commentaire:

Enregistrer un commentaire