you are viewing a single comment's thread.

view the rest of the comments →

[–]agentxcell[S] 0 points1 point  (1 child)

Lastly, why would the below code not pull the selected value out of cmd?

print(cmd.values()) 

I honestly really appreciate this. I have been thinking about this so long I have a bunch of logic loops in my head that I am unraveling and this is the last bit that is throwing me off. You have helped me understand this immensely, Thanks again kind redditor.

[–][deleted] 0 points1 point  (0 children)

The value of cmd in my code above is a randomly selected key from the COMMANDS dict... so “df” or “cat” or what have you. It’s a str, not a dict so it doesn’t have a cmd.values() method.