0

I was wondering if there was a way to use the values in a list
one would create.

Such as

secrete_door = [1,2,3,4]

print "Choose the right door and you may proceed."
print "Guess a door 1 through 4."
# I would like to pull a number from the list
if "1" in secrete_door:
    print "Sorry try again."





#is this possible?
2
Contributors
1
Reply
17
Views
3 Years
Discussion Span
Last Post by ddanbe
1

Hi Aakeem welcome at DaniWeb!
I'm perhaps more newbie than you concerning Python, but this works with me:

secrete_door = [1,2,3,4]

if 1 in secrete_door:
    print( "Sorry try again.")

You have a range of integers, not a range of strings.

Edited by ddanbe: simplified

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.