I'm very new to Python, but it seems like I just learned in a class for a random number, you would need the : import random
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Christopher Marlett Sent: Thursday, March 13, 2008 7:44 PM To: tutor@python.org Subject: [Tutor] Idle Hi, I'm trying to write a program that uses the range function to produce and then print [1, 2, 3, 4]. then prompt the user for an integer n and print the list [1, 2, 3, ... , n] - including n. Then use a simple repeat loop to print five randomly chosen numbers from the range [1, 2, 3, ... , n] This is what I have done so far print [1,2,3,4] nstring = raw_input("Enter any number: ") n = int(nstring) print range(1,n+1) y = random.randrange(1,n) print y It all works up until I need to print five randomly chosen numbers from the range [1,n]. It tells me that random is not defined. Thank you for your time. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor