# Nicolas Gomez 11/10/21
# I learned how to open files and append them. Then I learned how to convert text to a list
# I did not have difficulty during this
# [] create The Weather
#Get File
!curl https://raw.githubusercontent.com/MicrosoftLearning/intropython/master/world_temp_mean.csv -o mean_temp.txt
##Add City to file
city_file = open('mean_temp.txt', 'a+')
city_file.write('Rio de Janeiro,Brazil,30.0,18.0')
##Get heading
city_file.seek(0)
headings = city_file.readline()
heading = headings.split(',')
##Get the City and temp from the reaming lines of text and print the
city_temp = city_file.readline()
while city_temp:
cities = city_temp.split(',')
print(heading[0].title(), 'of', cities[0], heading[2], 'is', cities[2], 'Celcius')
city_temp = city_file.readline()
city_file.close()
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 222 100 222 0 0 2000 0 --:--:-- --:--:-- --:--:-- 2000
City of Beijing month ave: highest high is 30.9 Celcius
City of Cairo month ave: highest high is 34.7 Celcius
City of London month ave: highest high is 23.5 Celcius
City of Nairobi month ave: highest high is 26.3 Celcius
City of New York City month ave: highest high is 28.9 Celcius
City of Sydney month ave: highest high is 26.5 Celcius
City of Tokyo month ave: highest high is 30.8 Celcius
City of Rio de Janeiro month ave: highest high is 30.0 Celcius