S
SpringFlowers AutumnMoon
the following syntax error for "elif" is not caught? (should be elsif)
def foo(i)
if i < 0
return "Less than 0"
elif i == 0
return "it is zero"
else
return "Greater than 0"
end
end
p foo(-2)
p foo(0)
p foo(10)
==================
Output:
"Less than 0"
"Greater than 0"
"Greater than 0"
def foo(i)
if i < 0
return "Less than 0"
elif i == 0
return "it is zero"
else
return "Greater than 0"
end
end
p foo(-2)
p foo(0)
p foo(10)
==================
Output:
"Less than 0"
"Greater than 0"
"Greater than 0"