Next, copy in your strip_punctuation function and define a function called get_pos which takes one parameter, a string which represents one or more sentences, and calculates how many words in the string are considered positive words. Use the list, positive_words to determine what words will count as positive. The function should return a positive integer - how many occurrences there are of positive words in the text. Note that all of the words in positive_words are lower cased, so you’ll need to convert all the words in the input string to lower case as well.
Answers
Answer:
ohh........... can't understand your question
Explanation:
sorry if you think bad
Language using: Python Programming
Program:
positive_words=['happy', 'strong', 'brainly', 'peace', 'well']
count=0
def strip_punctuation():
x=input().lower()
punctuations = '''!()-[]{};:'"\,<>./?@#$%^&*_~'''
for i in x:
if i in punctuations:
x=x.replace(i,"")
return get_pos(x)
def get_pos(x):
x=list(x.split(' '))
global count
for i in x:
if i in positive_words:
count=count+1
return count
print(strip_punctuation())
Input:
Hey, dear strong girl! Hope you are doing well, and leading a happy life that is filled with full of peace. Thank you for joining brainly. Brainly is happy to have you aboard. See you soon happy face!
Output:
8
Learn more:
1) Printing all the palindromes formed by a palindrome word.
brainly.in/question/19151384
2) Write a Python function sumsquare(l) that takes a nonempty list of integers and returns a list [odd,even], where odd is the sum of squares all the odd numbers in l and even is the sum of squares of all the even numbers in l.
brainly.in/question/15473120