import re
test_str = ("Bombay Red 2 kg Onion 3kg\n"
"Bombay 1 kg Red 2 kg Onion 5 kg\n"
"Bombay Red Onion 1kg\n"
"Bombay Red Onion 120 kg\n"
"Bombay Red Onion 12 kg\n"
"Bombay Red Onion\n")
regex = re.compile(r"\d+ ?kg$", flags=re.MULTILINE)
replacedStr = regex.sub("", test_str)
print(replacedStr)