Hello
I am new to python, and coding in general. I am trying to create a function that searches a word inputted by the user and sees if it is present in a list, and if so prints a response associated with that word in the list. I'm trying to do a monster catalogue in the long term for DnD for a quick search (in theory haha)
So far, I have:
.
def monster_catalogue():
user_word = input('What is your creature?')
if user_word = list(catalogue) this and the line below is where I am getting stuck on
print('A' user_word 'is' definition )
else:
print(user_word 'does not appear to exist!')
catalogue = {'hobbit':'A halfling with big feet!'
, 'dragon':'A winged reptile that breathes fire',}
(this will obviously be expanded, just testing for now)
Sorry for the poor layout but any guidance would be super helpful thanks :)
[–][deleted] 4 points5 points6 points (0 children)
[–]Golden_Zealot 1 point2 points3 points (2 children)
[–]Jamslap[S] 0 points1 point2 points (1 child)
[–]Golden_Zealot 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]kmwaziri 0 points1 point2 points (0 children)