-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathListas.py
More file actions
37 lines (22 loc) · 766 Bytes
/
Listas.py
File metadata and controls
37 lines (22 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#Declarar lista con tamaño 10
#Definir Valores enteros
#Elevar a la quinta potencia los numeros impares
#Multiplicar por el num anterior el numero par
#Imprimir resultados
lista = [0]*10
for i in range(10):
lista[i] = int(input("Ingrese un numero entero: "))
for i in range(10):
if lista[i] % 2 != 0:
print(f"El numero {lista[i]} es impar.")
lista[i] = lista[i] ** 5
print(f"elevado a la quinta potencia es {lista[i]}.")
print("----" * 20)
else:
print(f"El numero {lista[i]} es par.")
if i == 0:
lista[i] = lista[i] * (-1)
else:
lista[i] = lista[i] * lista[i-1]
print(f"multiplicado por el numero anterior es {lista[i]}.")
print("----" * 20)