SHARE
TWEET

ex3

a guest May 23rd, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. archivo = open("datapromestud.csv","r")
  2.  
  3. counter=0
  4. counterlines=0
  5. counterpromedio=0
  6. for linea in archivo:
  7.     if counter==0:
  8.         pass
  9.     else:
  10.         counterlines+=1
  11.         lista=linea.strip().split(",")
  12.         #print lista
  13.         #ID= lista[0].replace('"',"")
  14.         #RUT_ID= lista[1].replace('"',"")
  15.         Promedio= float(lista[2].replace('"',"").replace(" ",""))
  16.         counterpromedio+=Promedio
  17.     counter+=1
  18. promediocurso=counterpromedio/counterlines
  19. print round(promediocurso,1)
  20.  
  21. #print lista
  22. archivo.close()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top