Advanced python code challenges- control flow question 4

Hey,

im maybe 20% into the python instruction, and i have a question about some code, the answer key on question 4 movie reviews doesnt use the print() command, but its still printing in the console, why?

additionally, using my code below- the console prints the answer correctly, but inbetween the correct answers 1, 2 and 3, there is the word “none” in the console too… curious?

i modeled my code after the answer key, just tried to not copy it exactly as my code was initially wrong.

def movie_review(rating):

if (rating <= 5):

return print("avoid at all costs!")

elif (rating > 5 and rating < 9):

return print("This one was fun")

return print(“outstanding!”)

We can get around that by not printing in the function.

print (movie_review(7))

Just return the applicable string.

ohhhh, i didnt read carefully enough- thank you

1 Like