input: Write a function to design a machine learning algorithm in Python that can identify whether a given sentence is an 'affirmative' sentence or a 'negative' sentence. The function should return "Affirmative" if the sentence is affirmative, and "Negative" if the sentence is negative. If the sentence contains negation words, it should be classified as "Negative".
  assert isAffirmativeorNegative("He always comes late but I dont mind.") == "Negative"
  assert isAffirmativeorNegative("She is always cheerful and happy.") == "Affirmative"
  assert isAffirmativeorNegative("No one was present at the meeting.") == "Negative"
  assert isAffirmativeorNegative("The weather is perfect today.") == "Affirmative"
  assert isAffirmativeorNegative("I cannot attend the event.") == "Negative"
output: def isAffirmativeorNegative(sentence):
      negation_words = {"no", "not", "never", "none", "nobody", "nothing", "neither", "nor", "nowhere", "hardly", "scarcely", "barely", "don't", "doesn't", "didn't", "can't", "couldn't", "won't", "wouldn't", "isn't", "aren't", "ain't"}
      words = sentence.lower().split()
      for word in words:
          if word in negation_words:
              return "Negative"
      return "Affirmative"