Skip to content

Commit ff2ef18

Browse files
authored
Create Media_temperatura.py
1 parent e280d1f commit ff2ef18

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Media_temperatura.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
temp = []
2+
3+
mes = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"]
4+
5+
media = 0
6+
7+
8+
9+
for i in range(12):
10+
11+
valor = float(input("Digite a temperatura em ºC do %dº mês: " %(i+1)))
12+
13+
temp.append(valor)
14+
15+
media += valor
16+
17+
18+
19+
media = media/12
20+
21+
22+
23+
print("Meses com temperatura acima da média anual\n")
24+
25+
print("Média anual: %.1f" %media)
26+
27+
28+
29+
for i in range(12):
30+
31+
if temp[i]>media:
32+
33+
print("Mês %d - %s: %.1f ºC" %(i+1, mes[i], temp[i]))

0 commit comments

Comments
 (0)