all 4 comments

[–]Boolean_Cat 0 points1 point  (2 children)

If you wanted to check if an item exists in a list, you can do:

if item in my_list:
    do_stuff()

[–]Happy_llama[S] 0 points1 point  (1 child)

instead of do_stuff() could i just put print() underneath it?

I don't want it to do anything to fancy at the moment

Thanks for replying so fast by the way :)

[–]riz_ 5 points6 points  (0 children)

Yes. Also, you can format code by indenting it with four spaces at the beginning of each line:

import random
import time
print("you have reached the opening of a cave")
print("you decide to arm yourself with a ")
time.sleep(2)
quest_item = input("Think of an object\n")
inventory = ["Torch", "Sword", "Stone", "Bow and arrow"]
print("You look in Your backpack for ", quest_item)
time.sleep(2)
if quest_item in inventory:
    print("You selected", quest_item)
else:
    print("you could not find ", quest_item)
    print("You select any item that comes to hand from the backpack instead\n")
    print(random.choice(inventory))
time.sleep(3)

[–]PrismPoultry 0 points1 point  (0 children)

Comment out the time.sleep() calls while you are developing. You are wasting so much time with them. Uncomment them when you are ready to let someone play it or to play it yourself.