18 lines
433 B
Python
18 lines
433 B
Python
# Pedir números
|
|
numero1 = int(input("Ingrese el primer número: "))
|
|
numero2 = int(input("Ingrese el segundo número: "))
|
|
|
|
# Validar orden
|
|
if numero1 < numero2:
|
|
|
|
print(f"Números impares entre: {numero1} y {numero2}")
|
|
|
|
# Recorrer el rango
|
|
for i in range(numero1, numero2 + 1):
|
|
|
|
# Verificar si es impar
|
|
if i % 2 != 0:
|
|
print(i)
|
|
|
|
else:
|
|
print("El primer número debe ser menor que el segundo") |