Computes the sorted sequence of digits of the cube of num. >>> get_digits(3) '27' >>> get_digits(99) '027999' >>> get_digits(123) '0166788'
(num: int)
| 45 | |
| 46 | |
| 47 | def get_digits(num: int) -> str: |
| 48 | """ |
| 49 | Computes the sorted sequence of digits of the cube of num. |
| 50 | |
| 51 | >>> get_digits(3) |
| 52 | '27' |
| 53 | >>> get_digits(99) |
| 54 | '027999' |
| 55 | >>> get_digits(123) |
| 56 | '0166788' |
| 57 | """ |
| 58 | return "".join(sorted(str(num**3))) |
| 59 | |
| 60 | |
| 61 | if __name__ == "__main__": |