#John Bible 11/5/21
#What I learned was how to import and open a file, add additional data to the file, and read and display certain information from a file.
#What I had problems with was nothing I got through this just fine.
# [] create The Weather
#This will import a site, add a line of text, and then starts reading through the file while printing out outputs until it runs out of indexes before closing the file.
!curl https://raw.githubusercontent.com/MicrosoftLearning/intropython/master/world_temp_mean.csv -o mean_temp.txt
mean_temp=open("mean_temp.txt","a+")
mean_temp.write("\nRio de Janeiro,Brazil,30.0,18.0")
mean_temp.seek(0)
headings=mean_temp.readline().split(",")
print("City of",headings[0],"month ave: highest high is",headings[2],"Celsius")
while mean_temp:
city_temp=mean_temp.readline().split(",")
print("City of",city_temp[0],"month ave: highest high is",city_temp[2],"Celsius")
mean_temp=mean_temp.close()
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 222 100 222 0 0 8538 0 --:--:-- --:--:-- --:--:-- 8538
City of city month ave: highest high is month ave: highest high Celsius
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