1 defseach_phone_nmuber_operator ():2Cn_mobile = [134,135,136,137,138,139,150,151,152,157,158,159,182,183,184,187,188,147,178,1705]3Cn_union = [130,131,132,155,156,185,186,145,176,1709]4cn_telecom = [133,153,180,181,189,177,1700]5 6PHONE_NMU = input ('Please enter the phone number to be queried:')7QC_RD = Phone_nmu[0:3]8 ifLen (PHONE_NMU) = = 11:9 ifphone_nmu.isdigit ():Ten ifInt (QC_RD)inchCn_mobile: One Print("The phone number you entered is:", PHONE_NMU) A Print("Supplier: China Mobile \ n") - elifInt (QC_RD)inchcn_union: - Print("The phone number you entered is:", PHONE_NMU) the Print("Supplier: China unicom \ n" ) - elifInt (QC_RD)inchcn_telecom: - Print("The phone number you entered is:", PHONE_NMU) - Print("Supplier: China Telecom \ n") + Else: - Print("the phone number segment you entered is not correct, please re-enter \ n") + Else: A Print("Invalid phone number, enter the phone number must be 11 digits \ n") at Else: - Print("Invalid phone number, please enter a 11-digit phone number \ n") -i = 1 - whilei >0: - Seach_phone_nmuber_operator () -Seach_phone_nmuber_operator ()
Python_ Search Phone Provider