(Feb-05-2020, 06:24 PM)micseydel Wrote:(Feb-05-2020, 05:03 PM)t4keheart Wrote: I want to be able to pull specific lines, by referencing the associated numbers on the left...Could you elaborate on this? I read your post 3 times trying to figure out your question, and this seems like it, but I don't know what it means, when it comes down to code.
I'm sorry if I wasn't clear. I will modify my post to try to be more direct about what I'm asking.
I need to write a function that takes the dictionary I posted in the original post as input, and returns only the last entry's 'body' value.
5366005: {'body': 'testing sms ID', 'msg_id': 5366005}}}So, 'testing sms ID' would be returned in this case.
I would also like to write a function that can be passed the msg_id (the number on the left for each entry, or key) and return the corresponding 'body' value.
for example, input '5366005' would also return 'testing sms ID'.
I'm not quite sure what I'm working with here which has made it difficult to research solutions. Is that a dictionary of dictionarys? A dictionary of lists?
Thank you for your time.