Why does this work?



When I hit save and submit, it works, but it doesn't sort my numbers! I would like to know how the code is actually supposed to look.

Replace this line with your code. 
def alphabetize(arr, rev=false)
    if rev == true
        return arr
numbers = [8,3,7,1,5]
puts numbers


You should call your function:

puts alphabetize(numbers)


thanks factoradic. I still don't understand why my code worked though. I guess it is just a bug.


You're welcome :slight_smile:

Why should not it work? Your function is correct. It's your choice if you want to call the function or not. Codecademy checks only whether the function works correctly.


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