[SOLVED] print a random variable? - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: Python Programming Language (https://www.supportforums.net/forumdisplay.php?fid=32) +---- Thread: [SOLVED] print a random variable? (/showthread.php?tid=1244) |
[SOLVED] print a random variable? - nevets04 - 10-11-2009 I want to print either a b or c randomly someone told me it was like this import random array = ['a','b','c','d','e','f'] random = random.choice(array) print (random) however I get this error when I do that Quote:Traceback (most recent call last): SOLVED: Thanks to bsdpunk and fallen, we were able to figure out, that by changing the name of the program. It worked. RE: print a random variable? - Nyx- - 10-11-2009 lol printin modules since day 1 son Code: import random IDLE Wrote:>>> import random RE: print a random variable? - nevets04 - 10-11-2009 (10-11-2009, 06:01 PM)Nyx- Wrote: lol printin modules since day 1 son I get that error posted above when I import random |