generate functionTue, 16 May 2023

ingresar un numero de tres crifras  y hallar si es capicua o no

def capicua(x): reverse_number = 0 n = x while n > 0: remainder = n % 10 reverse_number = (reverse_number * 10) + remainder n //= 10 if x == reverse_number: return 'capicua' else: return 'no capicua' capicua(123)

Questions about programming?Chat with your personal AI assistant