Skip to content

Tag: python

opening txt file and creating lists from the txt file

I’m trying to Read the file “covid.txt” into two lists. The first list should contain all the “day” values from the file. The second list should contain all the “new cases” values. my list in column I needed to be this way I have tried so many different things I&#8217…

How to read dictionaries in list of dictionaries in python

I am trying to read some JSON for a leaderboard for my discord bot, formatted like this: I can read the first part fine, but reading this list here is giving me some problems: How can I read the values of each of the dictionaries in the list? For example, say I want to get the dictionary with the key