def equip(x):
global bag_sword
global bag_chest
global bag_gloves
global bag_helmet
while x == "iron sword" and "iron sword" in bag:
if bag_sword:
print "You can't have 2 weapons equipped!"
x = ""
print "\nYou equip the iron sword.\n"
bag.remove("iron sword")
bag_sword.append("iron sword")
When I run this the first time, it works fine, but when I run it a second time nothing happens.
bag_sword is a list
test code:
bag.append("iron sword")
if input1[:5] == "equip":
print input1[:5]
equip(input1[6:])
print input1[6:]
I type into the console 'equip iron sword'
I've tried using a variable in place of the input[]
(It isn't syntax)