Skip to content

Instantly share code, notes, and snippets.

@JohnsonLuu
Created May 28, 2020 22:48
Show Gist options
  • Save JohnsonLuu/38a91e15c705e1ea01833a1c1af04c7d to your computer and use it in GitHub Desktop.
Save JohnsonLuu/38a91e15c705e1ea01833a1c1af04c7d to your computer and use it in GitHub Desktop.
"""
Create a function named movie_review() that has one parameter named rating.
If rating is less than or equal to 5, return "Avoid at all costs!". If rating is between 5 and 9, return "This one was fun.". If rating is 9 or above, return "Outstanding!"
"""
# Write your movie_review function here:
def movie_review(rating):
if (rating <= 5):
return "Avoid at all costs!"
if (rating < 9 and rating > 5):
return "This one was fun."
if (rating >= 9):
return "Outstanding!"
# Uncomment these function calls to test your movie_review function:
print(movie_review(9))
# should print "Outstanding!"
print(movie_review(4))
# should print "Avoid at all costs!"
print(movie_review(6))
# should print "This one was fun."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment