I already finished the project, but I am having trouble wanting to make it unique for myself. I have a list of 20 names for my variable. What I want to do is the following: Rather than printing all 20 names, I would like for it to print a randomized (or shuffled) list of 3 names.
I've been wrestling with this issue for a while, searching different examples and ideas, but I've been stuck. Perhaps it's something so simple, but my mind is drawing a blank. Any tips would be great!
Here is my code:
import random squad = ['Ashley', 'Kaiden', 'Liara', 'Tali', 'Garrus', 'Wrex', 'Shepard', 'Miranda', 'Mordin', 'Zaeed', 'Kasumi', 'Samara', 'Legion', 'Jacob', 'Grunt', 'Thane', 'Jack', 'James', 'EDI', 'Javik'] print random.shuffle(squad) print "Your squad:" for soul in squad: if soul == 'Legion': print "Does this unit have a soul?" break elif soul == 'Shepard': print "He's Commander Shepard! Space crime fighting and rocking the galaxy!" break print soul else: print "The best of the best!"