# Michael Kirby
# 4/25/2022
# I didn't learn anything
# Sorry for the delay I forgot I still needed to turn this in. I'm not sure what the error is considering it worked
# [] create The Weather
# Imports mean_temp.txt
!curl https://raw.githubusercontent.com/MicrosoftLearning/intropython/master/world_temp_mean.csv -o mean_temp.txt
# Sets the variable mean_temp_file to open mean_temp.txt in a+ mode
mean_temp_file = open("mean_temp.txt","a+")
# Writes the following onto the end of mean_temp_file
mean_temp_file.write("\nRio de Janerio,Brazil,30.0,18.0")
# Brings the mean_temp_file pointer to the beginning of the file
mean_temp_file.seek(0)
# Sets the variable headings to read the first line of the file
headings = mean_temp_file.readline()
# Sets headings_list to split the first line at the commas
headings_list = headings.split(',')
# Displays headings_list
print(headings_list)
# Sets city_temp to read each line of mean_temp_file
city_temp = mean_temp_file.readline()
# Says while city_temp do this (FOREVER LOOP)
while city_temp:
# Sets city_temp_list to the variable city_temp split at the commas
city_temp_list = city_temp.split(",")
# Displays a combination of strings and indexes from both lists
print(headings_list[2],"for",city_temp_list[0],"is",city_temp_list[2],"Celsius")
# Reassigns city_temp
city_temp = mean_temp_file.readline()
# Closes the file variable mean_temp_file
mean_temp_file.close()
print(city_temp_list)