Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

why does my function print none

# You must be printing a function, that has print, statement. Use return instead of print.
def movie_review(rating):
  if rating <= 5:
    return “Avoid at all costs!”
  elif rating > 5 and rating < 9:
    return “This one was fun.”
  else:
    return “Outstanding!”
print(movie_review(10))
# If you have print in the place of return and in line 9; you are exicuting a print action, you get none.
Source by discuss.codecademy.com #
 
PREVIOUS NEXT
Tagged: #function #print
ADD COMMENT
Topic
Name
5+5 =