#I just have these up here for context
def ifhealthlessthan50():
while health<=50:
choice2 = input("YOU ARE LOW ON HEALTH WHAT WOULD YOU LIKE TO DO?\n> ")
if choice2.lower() == 'move n':
print(random.choice(biomes), "IS WHERE YOU END UP")
elif choice2.lower() == 'move s':
print("pls ")
print(random.choice(biomes), "IS WHERE YOU END UP")
elif choice2.lower() == 'move e':
print("are")
print(random.choice(biomes), "IS WHERE YOU END UP")
elif choice2.lower() == 'move w':
print("gosh")
print(random.choice(biomes), "IS WHERE YOU END UP")
elif choice2.lower() == 'exit':
print("NOW EXITING...")
sys.exit()
elif choice2.lower() == 'inventory':
print(things)
elif choice2.lower() == 'craft':
craftinginput = input("WHAT WOULD YOU LIKE TO CRAFT?\n> ")
if craftinginput.lower() == 'wpickaxe':
things.remove('PLANKS')
things.remove('PLANKS')
things.remove('PLANKS')
things.remove('STICKS')
things.remove('STICKS')
elif craftinginput.lower() == 'wsword':
things.remove('PLANKS')
things.remove('PLANKS')
things.remove('STICKS')
elif craftinginput.lower() == 'wshovel':
if 'PLANKS' and 'STICKS' and 'STICKS' not in things:
print("YOU DON'T HAVE THE RIGHT MATERIALS!")
elif 'PLANKS' and 'STICKS' and 'STICKS' in things:
things.remove('PLANKS')
things.remove('STICKS')
things.remove('STICKS')
else:
print("YOU DON'T HAVE THE RIGHT/ENOUGH MATERIALS!")
else:
print("THAT'S NOT A CRAFTABLE ITEM!")
else:
print("dont work lmao")
ifhealthlessthan50()
ifhealthlessthan50()
I'm trying to make it so when I don't have all of the materials it displays YOU DON'T HAVE THE RIGHT/ENOUGH MATERIALS! But instead, I get this error this is just one of the functions (the only one where the problem is) I'm really not sure how to fix this, I've looked at many posts here.
ValueError: list.remove(x): x not in list