Standardize Mobile Number Using Decorators

  • + 0 comments

    More pythonic way and energy efficient execution

    def fun(l):
            nums = sorted([num[-10:-5] + num[-5:] for num in l if len(num) >= 10])
            print('\n'.join(f"+91 {str(num)[0:5]} {str(num)[5:]}" for num in nums))
        return fun