I cannot get the following code to fire when I type any of my currently held items in to use. I do an inventory check just before this and have.
"You are holding: ['GOLD', 'SWORD', 'STONE MARBLE']"
placed there with
inventory = []
inventory.append("GOLD")
inventory.append("SWORD")
inventory.append("STONE MARBLE")
but when I type STONE MARBLE into the following input, it fires the else statement.
def statue_item_room():
print("Which item do you wish to use?")
item = input("> ")
if item.upper() == ("STONE MARBLE" and item.upper in inventory):
print(f"You attempt to fit the {item} into the eye socket")
input("< ")
print("There is a slight rumble as the statues eye clicks into place, the portcullis slams shut over the left exit and another hidden one slams down from your entrance. Now all exits are sealed and you will eventually starve to death in the chamber, unless something more horrible happens....")
dead("YOU STARVED")
elif item.upper() == ("GLASS MARBLE" and item.upper in inventory):
print(f"You attempt to fit the {item} into the eye socket")
input("< ")
print("There is a slight rumble as the statues eye clicks into place, the portcullis rises up as the eye shines bright. WIthout hesitation you step forward through the archway")
door_room()
else:
print(f"You do not have {item}, pick AGAIN or type LEFT to leave by the open exit")
choice = input("> ")
if choice.upper() == "AGAIN":
statue_item_room()
elif choice.upper() == "LEFT":
skeleton_room()
Any help appreciated.