Downto method does not work with strings


Both in the code editor and in a real-life ruby interpreter, I get the following error message:

undefined method `downto' for "Z":String

It's rather misleading to infer, and to allow students to infer, that the "downto" method works with strings because the "upto" method does. There should be a disclaimer about this.

# Write your code below!
# This works
"L".upto("P") { |letter| puts letter }
# This doesn't work
"Z".downto("S") { |new_letter| puts new_letter }


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