!curl https://raw.githubusercontent.com/MicrosoftLearning/intropython/master/world_temp_mean.csv -o mean_temp.txt
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 222 100 222 0 0 2288 0 --:--:-- --:--:-- --:--:-- 2288
# [] create The Weather
weather_file = open('mean_temp.txt', 'a+')
weather_file.write("\nRio de Janeiro,Brazil,30.0,18.0")
weather_file.seek(0)
headings = weather_file.readline()
headings = headings.split(',')
city_temp = weather_file.readline()
while city_temp:
city_temp = city_temp.split(',')
print(headings[0].capitalize()+ " of " + city_temp[0].title() + " " + headings[2] + " is " + city_temp[2] + " Celsius")
city_temp = weather_file.readline()
weather_file.close()
# It was okay to submit
City of Beijing month ave: highest high is 30.9 Celsius
City of Cairo month ave: highest high is 34.7 Celsius
City of London month ave: highest high is 23.5 Celsius
City of Nairobi month ave: highest high is 26.3 Celsius
City of New York City month ave: highest high is 28.9 Celsius
City of Sydney month ave: highest high is 26.5 Celsius
City of Tokyo month ave: highest high is 30.8 Celsius
Execution error
IndexError: list index out of range