We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Standardize Mobile Number Using Decorators
Standardize Mobile Number Using Decorators
Sort by
recency
|
211 Discussions
|
Please Login in order to post a comment
def wrapper(f): def fun(l): return f(j[::-1] for j in [i[:-11:-1][:5]+ " " + i[:-11:-1][5:] +" 19+" for i in l]) return fun
The other solutions here did nothing to help me actually understand decorators. Yes you can just completely replace the print statement in sort_phone(l)/f(l) by putting one in fun(l), but I don't think that's the intended solution or what decorators are usually used for. Here's another solution:
def wrapper(f):