def shout(phrase):
if phrase == phrase.upper():
return ("YOU'RE TOO LOUD")
else:
return ("Can you speak up, I can barely hear you")
shout("I'M INTERESTED IN SHOUTING")
Asked
Active
Viewed 56 times
-1

John Kugelman
- 349,597
- 67
- 533
- 578
-
Also, please don't downvote this. I already had to wait 2 weeks to post this question because it, "wasn't well received by the community." – NaveenKrishna Jul 07 '22 at 15:02
-
Please read [ask] and https://meta.stackoverflow.com/questions/261592, and try to look for existing answers before posting a question. Questions get downvoted because they are judged not to be useful to the site. Please keep in mind that this is **not a discussion forum**; questions are supposed to help build an organized, searchable reference library. – Karl Knechtel Aug 17 '22 at 02:09
2 Answers
1
You just need to wrap the function call in a print statement.
def shout(phrase):
if phrase == phrase.upper():
return ("YOU'RE TOO LOUD")
else:
return ("Can you speak up, I can barely hear you")
print(shout('hello'))
print(shout('HELLO'))
# Can you speak up, I can barely hear you
# YOU'RE TOO LOUD

Johnny John Boy
- 3,009
- 5
- 26
- 50
-1
Replace return with the print() function
def shout(phrase):
if phrase == phrase.upper():
print("YOU'RE TOO LOUD")
else:
print("Can you speak up, I can barely hear you")
shout("I'M INTERESTED IN SHOUTING")

Fquak
- 1
- 5