Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. temp_file = open('mean_temp.txt','a+')
  2. temp_file.write("Rio de Janeiro,Brazil,30.0,18.0\n")
  3. temp_file.seek(0,0)
  4. headings = temp_file.readline()
  5. headings = headings.split(',')
  6. city_temp = temp_file.readline()
  7. while city_temp:
  8. city_temp = city_temp.split(',')
  9. print(headings[0].capitalize(),"of",city_temp[0],headings[2],"is",city_temp[2],"Celsius.")
  10. city_temp = temp_file.readline()
  11. temp_file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement