Skip to main content
se añadieron 30 caracteres en el cuerpo
Origen Enlace
user128299
user128299

numbers = [1, 3, 25, 17, 6, 12, 9]

for number in numbers: if number % 2 == 0: print(f"This {number} is even.") else: print (f"This {number} is odd.")

numbers = [1, 3, 25, 17, 6, 12, 9]

for number in numbers:
    if number % 2 == 0:
        print(f"This {number} is even.")
    else:
        print (f"This {number} is odd.")

numbers = [1, 3, 25, 17, 6, 12, 9]

for number in numbers: if number % 2 == 0: print(f"This {number} is even.") else: print (f"This {number} is odd.")

numbers = [1, 3, 25, 17, 6, 12, 9]

for number in numbers:
    if number % 2 == 0:
        print(f"This {number} is even.")
    else:
        print (f"This {number} is odd.")
Origen Enlace

Alguien sabe si hay otra manera para escribir este codigo y que me regrese el mismo resultado

numbers = [1, 3, 25, 17, 6, 12, 9]

for number in numbers: if number % 2 == 0: print(f"This {number} is even.") else: print (f"This {number} is odd.")