Last active
July 5, 2021 21:30
-
-
Save natan20200679/3099afb6ac4d7b0cf436e72e56f568ba to your computer and use it in GitHub Desktop.
Lista de Exercícios Python Brasil
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ Faça um programa que receba a temperatura média de cada mês do ano e armazene-as em uma lista. Após isto, calcule a média | |
| anual das temperaturas e mostre todas as temperaturas acima da média anual, e em que mês elas ocorreram (mostrar o mês por | |
| extenso: 1 – Janeiro, 2 – Fevereiro, . . . ). """ | |
| temp_meses = [] | |
| soma = 0 | |
| for i in range(1,3): | |
| temp_mes = int(input("Temperatura Média:")) | |
| temp_meses.append(temp_mes) | |
| soma += temp_mes | |
| i += 1 | |
| media_anual = soma / len(temp_meses) | |
| temp_acima = [c for c in temp_meses if c > media_anual] | |
| print(temp_acima) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Só postando um gist novo para ter a formatação?
Só é fazer isso acima.