15. Iterating over a list in a function ("reslut not defined")


#1



If you have problem with "reslut is not defined"
Maybe this is a bug or I have done something wrong.

https://www.codecademy.com/courses/python-beginner-nzzVa/3/4?curriculum_id=4f89dab3d788890003000096




#This is working
n = [3, 5, 7]

def total(x):
    reslut = 0
    
    for i in range(0, len(x)):
        reslut = reslut + x[i]
    return reslut
    
print total(n)

#INSTEAD OF THIS

n = [3, 5, 7]

def total(x):
    result = 0
    
    for i in range(0, len(x)):
        result = result + x[i]
    return result
    
print total(n)


#2

check your spelling


#3

You beat me to it, again, in the first return result is indeed misspelled


#4

My secret is to make my replies shorter and more vague.


#6

No more code for me today.. Thanks and have a nice day! xD