#Helina Hailu
#January 9, 2022
#I reviewed previous methods like input, while, open .split(), .readline(), .seek(), .write(), and .close().
#I had no difficulty completing this task.
# [] create The Weather
#importing the web address and opening the file. I then read the file from the beginning and split at every comma and print it and close the file
!curl https://raw.githubusercontent.com/MicrosoftLearning/intropython/master/world_temp_mean.csv -o mean_temp.txt
mean_file = open("mean_temp.txt","a+")
mean_file.write("Rio de Janeiro,Brazil,30.0,18.0")
mean_file.seek(0)
headings = mean_file.readline().split(",")
print(headings,"\n")
city_temp = mean_file.readline()
while city_temp:
temp_list = city_temp.split(',')
print(headings[2] + " for " + temp_list[0] + " is " + temp_list[2] + " Celsius")
city_temp = mean_file.readline()
mean_file.close()