Generation

generate functionSun, 13 Nov 2022

Convert number to reversed array of digits Given a random non-negative number, you have to return the digits of this number within an array in reverse order.

def digitize(n): return [int(x) for x in str(n)[::-1]] digitize(35231)

Questions about programming?Chat with your personal AI assistant