How to remove a sublist which starts with particular element in python 3?
updated_code_result_2_2 =[["DR JOHN","HOSPITAL"],["TOTAL CHARGES","5OO"],["yes"]]
def remove_dr(updated_code_result_2_2):
rem_list = []
rem_ele_list = ['DR','TOTAL']
for x in updated_code_result_2_2:
for i in rem_ele_list:
if not x[0].startswith(i):
rem_list.append(x)
print(rem_list)
return rem_list
remove_dr(updated_code_result_2_2)
Expected Output: [["yes"]]