def pretify phone phone str phone if len phone 11 phone format phone p

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
def pretify(phone):
phone = str(phone)
if len(phone) == 11:
phone = '+{0}({1}) {2} {3} {4}'.format(phone[0],phone[1:4],phone[4:7],phone[7:9],phone[9:11])
return phone
## pretify(f) => '+8(921) 777 99 11'