Example:
Input = 'The ice cream is not bad!'
Output = 'The ice cream is good!"
Input = 'The ice cream is not that bad!'
Output = 'The ice cream is good!"
Input = 'The ice cream is NOT bad at all!'
Output = 'The ice cream is good at all!"
Input = 'The ice cream is not strawberry flavor, but the vanilla flavor is also not bad!'
Output = 'The ice cream is good!"
def positiveGenerator(s):
temp = s.upper()
n = temp.find("NOT")
b = temp.find("BAD")
if n < b:
answer = s[:n] + "good" + s[(b+3):]
return answer
else:
return s
# print(n, b)
s = input()
print(positiveGenerator(s))
output:
Get Answers For Free
Most questions answered within 1 hours.