Originally posted by vinnic12
I have this school project where I need to make groups randomly with python...we have most of it set up and running fine but I wanted to know if someone could help me get it so that it will not print the same name twice as in vinny vinny or joe joe
Heres the python Code:
import random
mylist = ['anthony', 'kris', 'james', 'vinny', 'joe']
randomList1 = random.randrange(0,len(mylist))
randomList2 = random.randrange(0,len(mylist))
name2 = mylist[randomList1]
name3 = mylist[randomList2]
print 'The group will consist of', name2, 'and', name3,'. '
help will be REALLY appreciated
Is it showing like this? 'The group will consist of', Kriss Kris, 'and', Vinny Vinny,'. ' Showing both names still? Or is it just posting the same name in BOTH spaces?