 <p>Here is how you can make the function work as described:</p> <pre><code>bag_sword = [] def equip(x): global bag_sword if x == "iron sword": if "iron sword" in bag_sword: print "You can't have 2 weapons equipped!" else: bag_sword.append("iron sword") print bag_sword # Prints "[]". equip("iron sword") # Prints nothing. Puts the string "iron sword" in bag_sword. print bag_sword # Prints "['iron sword']". equip("iron sword") # Prints "You can't have 2 weapons equipped!". bag_sword is unchanged. </code></pre>