Did not use " \" but code works?


#1

Hello

Here is my code -

def get_average(student):
homework = average(student["homework"])
quizzes = average(student["quizzes"])
tests = average(student["tests"])
return 0.1 * homework + 0.3 * quizzes + 0.6*tests

It worked, got my 'green' bookmark. But I did not use the \ as demonstrated in the example.
Is this good or bad? Were we suppose to use it, because I did but kept getting the the error - "Unexpected character after continuation character". Just need insight, were we suppose to use the continuation character? Also I got the 'green' bookmark but "None" appeared in console Window, am I doing this exercise right?

Thanks


#2

There is always more than one way to solve a problem. Congrats, you probably found a new way to solve the problem! :stuck_out_tongue_closed_eyes:


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.