Professional Documents
Culture Documents
AI/PYTHON_WARMUP_SESSION_2
HOME ASSIGNMENT 1
WHAT IS AN API?
API is the acronym for application programming interface. It is a software intermediary that allows two applications to
communicate with each other.
tweets = [
"I am very happy today.",
"I feel sad.",
"I do not like this product.",
"The product is good but the delivery system is very poor.",
"I like to eat pizza."
]
if polarity > 0:
sentiment = "Positive"
elif polarity < 0:
sentiment = "Negative"
else:
sentiment = "Neutral"
print(f"Tweet: {tweet}")
print(f"Sentiment: {sentiment} (Polarity: {polarity}, Subjectivity: {subjectivity})")
print()
OUTPUT: