Skip to content

Jheniffer Akycharia#17

Open
jhenifferakycharia wants to merge 1 commit intoreprograma:mainfrom
jhenifferakycharia:main
Open

Jheniffer Akycharia#17
jhenifferakycharia wants to merge 1 commit intoreprograma:mainfrom
jhenifferakycharia:main

Conversation

@jhenifferakycharia
Copy link

Questão 5 - Criei vetores para armazenar o valor inserido na range e os condicionais if e else para distinguir par e ímpar.
Questão 36 - Utilizei range para calcular os valor solicitados ao usuário.

for i in range(20):
numero = int(input("Digite um número inteiro: "))
numeros.append(numero)
if numero % 2 == 0:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pode usar somente o if numeros % 2:, mas não está errado assim!

# Leitura dos 20 números inseridos e diferenciação entre par e ímpar
for i in range(20):
numero = int(input("Digite um número inteiro: "))
numeros.append(numero)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arreasou usando o mesmo for para receber E tratar os valores!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants