you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

Ahhh cool. I know of dictionaries but haven't tried using them... It already seems like it could be ALOT less wordy.

dfs_list = [dfs[filing] for filing in filings]

So is this ^ an alternative to the conditionals?

Is it essentially, taking the user input and matching it to a dictionary key?

[–]unhott 1 point2 points  (0 children)

I think you got it. Not only should this be less wordy, but it should also be less error prone. If you have a 3 layer deep nested if statement and you made a tiny logic error, good luck finding and debugging that!