@frappe.whitelist()
def get_contact_number(contact_name, value, key):
 number = frappe.db.sql((u'select mobile_no, phone from tabContact where name=%s and %s=%s' % (u'%s', frappe.db.escape(key), u'%s')), (contact_name, value))
 return ((number and (number[0][0] or number[0][1])) or u'')

@ frappe . whitelist ( ) def get_contact_number ( contact_name , value , key ) : number = frappe . db . sql ( ( u'select mobile_no, phone from tabContact where name=%s and %s=%s' % ( u'%s' , frappe . db . escape ( key ) , u'%s' ) ) , ( contact_name , value ) ) return ( ( number and ( number [ 0 ] [ 0 ] or number [ 0 ] [ 1 ] ) ) or u'' )
returns mobile number of the contact .