Menu

gitpiper

digitize python Code Snippet in 2022

mathlistbeginner

Last Updated: 28 December 2022

Converts a number to a list of digits.

  • Use map() combined with int on the string representation of n and return a list from the result.
def digitize(n): return list(map(int, str(n)))
digitize(123) # [1, 2, 3]

python snippet similar to digitize For You in December 2022

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2022 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️