Generation

generate functionMon, 15 May 2023

Utilizando un bucle for y un único if sencillo con la condición (numero%3==0), crea un programa que pida un número entero y muestre una lista con todos los números enteros menores o iguales que el introducido que no sean múltiplos de 3.

def list_numbers(): x=int(input("Dame un número entero:")) lista=[] for i in range(x,0,-1): if i%3!=0: lista+=[i] return lista list_numbers()

Want to kickstart your project?Use the new AI Studio to create your code