You are viewing a single comment's thread. Return to all comments →
def fun(l): li = [] for i in l: if len(i) == 10: x = i[0:5] + i[5:] li.append(x) elif len(i) > 10 and i[0] == "0": y = i[1:6] + i[6:] li.append(y) elif len(i) > 10 and i[0] == "+": w = i[3:8] + i[8:] li.append(w) else: z = i[2:7] + i[7:] li.append(z) li.sort() # Sort the numbers for j in li: p = str(j) print(f"+91 {p[0:5]} {p[5:]}")
Seems like cookies are disabled on this browser, please enable them to open this website
Standardize Mobile Number Using Decorators
You are viewing a single comment's thread. Return to all comments →