lucast0rres

Lista4 - 7

May 18th, 2016
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. vetor = []
  2. maiortemp = 0
  3. menortemp = 0
  4. dias = 0
  5. media = 0
  6. soma = 0
  7.  
  8. for j in xrange(5):
  9.     x = float(input("Digite a temperatura em Celsius: "))
  10.     vetor.insert(j, x)
  11.    
  12.     if (vetor[j] < menortemp) or (j == 1):
  13.         menortemp = vetor[j]
  14.    
  15.     if (vetor[j] > maiortemp) or (j == 1):
  16.         maiortemp = vetor[j]
  17.        
  18.     soma = soma + vetor[j]
  19.  
  20. media = soma/5.0
  21.  
  22. for i in xrange(5):
  23.     if (vetor[i] < media):
  24.         dias = dias + 1
  25.  
  26. print "A menor temperatura ocorrida eh: ", menortemp
  27. print "A maior temperatura ocorrida eh: ", maiortemp
  28. print "A temperatura media eh: ", media
  29. print "Numero de dias nos quais a temperatura foi inferior a media: ", dias
Add Comment
Please, Sign In to add comment