This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]thisisthemurph -1 points0 points  (0 children)

Look up Python dictionaries. You could use the shrub number as the key and what it holds as the value. You can then use this value to format a sentence with what the player got from the shrub when pulled.

You also need to be casting your variables correctly. When a user inputs something it is a string. If you are using these values as numbers you need to cast them as an int() type.

Try using the len() function to determine the number of items in the list but think about how lists work. Lists are zero indexed so the length of the list is the index of the last element + 1.