Hi I am trying to create a function that capitalises a phrase so that it meets APA format i.e doesn't capitalise any unimportant words like a, an etc But I can't get it to work. I am a novice programmer so any tips would be appreciated. Below is my code:
def capitalise(phrase):
# your code goes here to perform the word capitalisation
p = str(phrase)
v = p.split()
for x in v:
if x != "a" or x != "an" or x != "the" or x != "am" or x != "is" or x != "are" or x != "and" or x != "of" or x != "In" or x != "on" or x != "with" or x != "from" or x != "to":
x.title()
print(x)