Search
 
SCRIPT & CODE EXAMPLE
 

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.
Comment

PREVIOUS NEXT
Code Example
Python :: tkinter askopen directory 
Python :: python package for facial emotion recognition 
Python :: how to install python on linux chromebook 
Python :: patoolib extract password-protected archives 
Python :: python cheat sheets 
Python :: ansible custom module 
Python :: pythonanywhere API example 
Python :: wn.synset vs wn.synsets in nltk 
Python :: looping through models and plotting their performance 
Python :: Basic 13 Algorithm 
Python :: newton backward interpolation python code 
Python :: Open AI Call 
Python :: python automation to sort files 
Python :: run windows command and get output python 
Python :: crank nicholson scheme python 
Python :: como tornar uma string numa lista 
Python :: calculate speed with time in datetime python 
Python :: spacy vietnamese 
Python :: python iterar claves 
Python :: part of list into dataframe 
Python :: ordereddict move to end 
Python :: 7616*75 
Python :: how to open a different version of python on my macc 
Python :: python3 array 
Python :: import data from website pandas python medium 
Python :: staff user is not restricting permission in django 
Python :: addinput() python 
Python :: sort dataset date wise in matplotlib 
Python :: how to get cube root python 
Python :: not to display column tree odoo 8 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =