Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- temp_file = open('mean_temp.txt','a+')
- temp_file.write("Rio de Janeiro,Brazil,30.0,18.0\n")
- temp_file.seek(0,0)
- headings = temp_file.readline()
- headings = headings.split(',')
- city_temp = temp_file.readline()
- while city_temp:
- city_temp = city_temp.split(',')
- print(headings[0].capitalize(),"of",city_temp[0],headings[2],"is",city_temp[2],"Celsius.")
- city_temp = temp_file.readline()
- temp_file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement