Oops, try again. It looks like your syntax isn't quite right. Check the first exercise if you need help!


I got some help and ended up with the code below, but when I ran it I got the message:(ruby):9: syntax error, unexpected ',', expecting ')'
alphabetize (numbers,true)

can you check this code:

def alphabetize (arr, rev=false)
    if rev == true

numbers = [5,1,3,8]

alphabetize (numbers,true)
puts numbers.map(&:inspect).join(',')
alphabetize (numbers)
puts numbers.map(&:inspect).join(',')


    return arr

All that is really needed is to puts the return value

puts alphabetize(numbers)


How come there is a return arr after the second to the last end? I mean, why return arr?


It's an expected return value in the exercise. Without it the SCT will see None and squawk about it. This way the alphabetized list gets sent back.


I'm sorry, could you please tell me what SCT is. Thank you.:slight_smile:


Submisson Correctness Test, a short lesson checker program that comes with each exercise.


thanks that cleared it up