Python: Return outside function error? Tried redoing indentation, spacing, etc.
Hi, I'm fairly new to python, and I keep getting an error 'return outside function'. I've looked around, and tried reformatting, redoing the indenting, and I still get the same error. Can anyone help me?
Code:
def syllableCount( someString ):
for syllSet in myDict[someString]:
for element in syllSet:
if (element[-1] == 0 or element[-1] == 1):
return element[-1]