Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions exercicios/para-casa/exercicio05.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
numeros = []
par = []
impar = []

for valor in range(20):
numero = int(input("Digite 20 números em sequência: "))
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.

Arrasou testando os valores no mesmo for do input!


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 numero % 2:, mas não está errado assim!

par.append(numero)
else:
impar.append(numero)


print(numeros)
print(par)
print(impar)
19 changes: 19 additions & 0 deletions exercicios/para-casa/exercicio36.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Desenvolva um programa que faça a tabuada de um número qualquer inteiro que será digitado pelo usuário,
# mas a tabuada não deve necessariamente iniciar em 1 e terminar em 10,
# o valor inicial e final devem ser informados também pelo usuário

numero_tabuada = int(input("insira o numero da tabuada: "))
valor_inicial = int(input("insira valor inicial: "))
valor_final = int(input("insira valor final: "))

if valor_inicial <= valor_final:
for numeros_multiplicaveis in range(valor_inicial, valor_final):
print(numeros_multiplicaveis)

while valor_inicial < valor_final:
numeros_multiplicados = numero_tabuada * valor_inicial
print(numeros_multiplicados)
valor_inicial = valor_inicial + 1
else:
print("o numero inicial precisa ser menor que o final. Refaça o programa")