0

Divisible case #3

numero = int(input()) numDiv = input() if " " in numDiv: numDiv = numDiv.replace(" ", "") for i in numDiv: if int(i) == 0: resultado = "not divisible by all" break div = numero%int(i) if div != 0: resultado = "not divisible by all" break else: resultado = "divisible by all" print (resultado) What would be needed in the code, since case 3 always gives an error.

12th Feb 2023, 4:09 AM
Luis Ernesto Cerón Guerrero
Luis Ernesto Cerón Guerrero - avatar
1 Odpowiedź
+ 5
Use numDiv = [int(v) for v in numDiv.split(' ')] instead of if " " in numDiv: numDiv = numDiv.replace(" ", "")
12th Feb 2023, 5:26 AM
SoloProg
SoloProg - avatar