Skip to content

Exercício Semana 4 #20

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

Exercício Semana 4 #20
TaianneR wants to merge 1 commit intoreprograma:mainfrom
TaianneR:main

Conversation

@TaianneR
Copy link

Questao 36 e questao 5



while comeco > final:

Copy link
Collaborator

Choose a reason for hiding this comment

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

boaaa!


#Faça um Programa que leia 20 números inteiros e armazene-os num vetor. Armazene os números pares no vetor PAR e os números IMPARES no vetor impar. Imprima os três vetores.

def main():
Copy link
Collaborator

Choose a reason for hiding this comment

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

Debochou usando main!!
Em python não é tão comum usar main dessa forma (usamos main e tem algumas diferenças das linguagens que costumam usar main() ), mas é um excelente sinal de dedicação e estudos. Parabééééns!

# Separa os números pares e ímpares
# for - para verificar se cada numero é par (num %2 ==0) o que identifica se for par, add a lista pares
for num in numeros:
if num % 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 num % 2:, mas não está errado assim!

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