[Tutor] Creating Lists

Alan Gauld alan.gauld at btinternet.com
Wed Nov 12 11:59:03 CET 2014


On 12/11/14 04:27, niyanaxx95 at gmail.com wrote:
> Create a list of 20 unique (no number appears twice) random integers
> with values between 1 and 45.

 > Print the list of random numbers with the header
> “Random list of 20 numbers”.

> Find the largest number in the list.
 > Remove the largest number from the list.

 > Find the smallest number in the list.
 > Remove the smallest number from the list.

> Print the length of the list with the header “The length of the list is: ”
> Print the list with the header “The list with the largest and smallest
> number removed: ”

OK, You've shown us your homework, it all looks very reasonable.
Now tell us what you have tried. How did it work?
Are there any bits you are stuck with?

Maybe we can help. But we won't just do your homework for you.

Tell us which version of Python you are using too, since that
will make a difference.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos



More information about the Tutor mailing list