Last active
May 24, 2017 20:35
-
-
Save sxslex/713ca127b781994eb48d4f85204ccd43 to your computer and use it in GitHub Desktop.
Decompoe um numero em sua representação decimal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
def decompor_decimal(num): | |
"""Decompoe um numero em sua representação decimal. """ | |
l = len(str(num)) | |
return ' + '.join([i.ljust(l - b, '0') for b, i in enumerate(str(num))]) | |
print(decompor_decimal(32477)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment