def remove_substring_from_string(s, substr):
s2 = s.split() substr2 = substr.split() for x in range(0,len(s2)): for y in range(0,len(substr2)):
if (s2[x]==substr2[y]): s2[x]=""
for x in range(0,len(s2)): print(s2[x],"",end="")
Also, using print leads to my output having None in it. So anyway to get rid of that would also be appreciated.