HackerRank Python - Standardize Mobile Number Using Decorators

Let's dive into decorators! You are given N mobile numbers. Sort them in ascending order then print them in the standard format shown below:

  1. def wrapper(f):
  2. def fun(l):
  3. f(['+91 ' + c[-10:-5] + ' ' + c[-5:] for c in l])
  4. return fun
  5. @wrapper
  6. def sort_phone(l):
  7. print(*sorted(l), sep='\n')
  8. if __name__ == '__main__':
  9. l = [input() for _ in range(int(input()))]
  10. sort_phone(l)
Please click on the like button if it worked

Solution not working or have any suggestions? Please send an email to [email protected]

donate a cup of tea :)

Join Our Facebook Group

Share this solution


Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube