How it can looks like when there will be another 5 conditions... ?
Try to rewrite it into linear form like this (caution, it wouldn't be exactly like this!):
if not required_word:
# Nothing was entered
message = "Enter some word."
if not my_vocabulary.exists_word:
...
The goal is to act on negative behaviour (like missing entered word) and keep the executing "bubble" till positive lines of code. Figure out to better passing message values.
Take a look at this piece of code as example (not only one): https://github.com/katkalouckova/my_vocabulary/blob/36fe2377d3ed45e25606972387c2cb8fb9331c1b/web.py#L43-L64
How it can looks like when there will be another 5 conditions... ?
Try to rewrite it into linear form like this (caution, it wouldn't be exactly like this!):
The goal is to act on negative behaviour (like missing entered word) and keep the executing "bubble" till positive lines of code. Figure out to better passing
message
values.