Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88809

Is there a easier way of making a excel spreadsheet that shows names of countries and their capitals in python?

$
0
0

I was assigned a hw assignment where I need to write a python program that would list the names of every country and their capital that uses both excel and word. I was told to pull the data from a website called api.worldbank.org and its in a JSON format which it's something I haven't done and will be taught to me in two weeks time and so I used a JSON format site to make it's valid JSON and so it was. Then so the main task of the hw was as mentioned in the first sentence to create a list of every country and their capital and not include anything that's not a country. So is there an easy of way of creating a list of every country and their capital in both excel and word ?

I went to a JSON formatter to format the part that was in JSON. This is the only thing that I have used.

list_of_things = world_bank_data[1]
country = list_of_things[0]['name']
capital = list_of_things[0]['capitalCity']
print(list_of_things[0])
print(f'The capital of {country} is {capital}')

I would be expecting a excel and word file being created and showing the list of names of each country and their capital.


Viewing all articles
Browse latest Browse all 88809

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>