6. just weight and see


#1

help please! thank in advance

def average(numbers):
    total = sum(numbers)
    total = float(sum(numbers))
    return total/len(numbers)
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)

File "python", line 28
SyntaxError: 'return' outside function


6. Just Weight and See
#2

def average(numbers):
    total = sum(numbers)
    total = float(sum(numbers))
    return total/len(numbers)
def get_average(student):
    homework = [average(student["homework"])]
    quizzes = [average(student["quizzes"])]
    tests = [average(student["tests"])]
return sum(0.1 * homework, 0.3 * quizzes, 0.6 * tests)

File "python", line 28
SyntaxError: 'return' outside function


#3

@orujgadimov,
Please re-edit your Post

  • leave one blank-line above of your code
  • select your code in the Post
  • then =click= on the </>-symbol-of-this-editor

Your code will then be in a pre-code state
and you will be able to make/present the proper indentations.

With Courtesy to stetim94
https://discuss.codecademy.com/t/im-having-a-problem-on-lesson-11-23/2307/3?u=leonhard.wettengmx.n

or even better use
= https://discuss.codecademy.com/t/how-do-i-format-code-in-my-posts/28351
[extra's]
https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet


#4

this line:

return sum(0.1 * homework, 0.3 * quizzes, 0.6 * tests)

is outside the function, re-indent it so it is inside the function


#5


#6

Can some one help me ?


#7