Just weight and see -unexpected character after line continuation character


#1

so this is my code, I also tried the longer version with 0.1*average(student['homework'])+ \ 0.3*average(student['quizzes'])+ \ 0.6*average(student['tests'])
but it still shows the error arrow to the very end of my code. saying SyntaxError: unexpected character after line continuation character

Add your function below!

def average (numbers):
total=sum(numbers)
total=float(total)
total/=len(numbers)
return total

def get_avarage(student):
homework=average(student['homework'])
quiz=average(student['quizzes'])
test=average(student['tests'])
return 0.1*homework+ \0.3* quiz+ \ 0.6*test


#2

This is the line where the error is triggered. I'm not certain about the rules for line continuation characters, but am going to assume they need to be enclosed in a string.

"some text, more text, \
    still more text, \
    last bit of text"

This permits authors to break up long strings. The return statement above does not need to be broken up.

return 0.1 * homework + 0.3 * quiz + 0.6 * test

After fixing this you will get another error. Check the name of the function for spelling error.