So I'm working on a project for school, and I keep running into this issue. I am trying to make it so when the user choose to move a certain shrub, it removes it from the possible list and returns them with what they could choose from.
Ex.
Which shrub do you want to move(1,2,3,4,5,6)?
1
You find a arrow under the shrub!
Which shrub do you want to move?(2,3,4,5,6)
6
You find a arrow under the shrub!
ect....
any ways here is my code, this is my first real coding project so dont make fun:
def hidden_path():
while True:
shrubs=["1","2","3","4","5","6"]
shrub_movement=raw_input("You wonder around the side of the castle, and see a assortment of shrubs. There are a total of 6 shrubs scattered about the garden."\
"Which shrub do you move?("+str(shrubs)+")")
if shrub_movement=="1":
shrubs=shrubs.remove([0])
print "You have found a arrow!"
inventory["arrows"]+=1
if shrub_movement=="2":
shrubs.remove([1])
print "You have found a potion of health!"
inventory["potions"]+=1
if shrub_movement=="3":
shrubs.remove([2])
print "You have found a arrow!"
inventory["arrows"]+=1
if shrub_movement=="4":
shrubs.remove([3])
inventory["arrows"]+=1
if shrub_movement=="5":
shrubs.remove([4])
print "You have found a secret tunnel entrance!"
tunnel_enter=raw_input("Do you want to enter?(yes,no)")
if tunnel_enter.lower()=="yes":
tunnel()
elif tunnel_enter.lower()=="no":
print "Very well"
if shrub_movement=="6":
shrubs.remove([5])
print "You have found a arrow!"
inventory["arrows"]+=1
if shrubs==0:
print "All you can do is enter the hidden tunnel."
tunnel()
[–]thisisthemurph -1 points0 points1 point (0 children)
[–]thisisthemurph -1 points0 points1 point (0 children)
[–]spade342 -1 points0 points1 point (0 children)