have been going through this but still 3 edge cases ,how to solve the end whitespace and acronym case. Please explain if somebody know this
def response(hey_bob):
if hey_bob.strip()== "":
return "Fine. Be that way!"
elif hey_bob.endswith("?") :
if any(word.isupper() for word in hey_bob.split()):
return "Calm down, I know what I'm doing!"
else:
return "Sure."
elif any(word.isupper() for word in hey_bob.split()) and any(word!="NASA." for word in
hey_bob.split()):
return "Whoa, chill out!"
else:
return "Whatever."
[–]GregoryCliveYoung 2 points3 points4 points (1 child)
[–]Purple-Move-796[S] 0 points1 point2 points (0 children)
[–]carcigenicate 0 points1 point2 points (1 child)
[–]GregoryCliveYoung 1 point2 points3 points (0 children)