You could first remove 515 as you have, and then loop through the contents of x[0] separately:
remove_element = '515'
x = [['510','511','512'],['510','515','516']]
for i in x:
if remove_element in i:
i .remove( remove_element )
for element in x[0]: ## ['510','511','512']
if element in x[1]: ## ['510','515','516']
x[1] .remove( element )
print(x)
or combine them into your remove list, then loop once:
#! /usr/bin/python3
remove = ['515'] ## make this a list
x = [['510','511','512'],['510','515','516']]
## add initial group of elements to your remove list
remove += x[0] ## ['515','510','511','512']
for element in remove: ## loop through list
if element in x[1]: ## scan for duplicates
x[1] .remove( element )
print(x)
[['510', '511', '512'], ['516']]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…