We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Ruby - Methods - Keyword Arguments
Ruby - Methods - Keyword Arguments
Sort by
recency
|
102 Discussions
|
Please Login in order to post a comment
I'm with a problem with my code, because it works when I run it on VScode, but when I try on HackerRank, it don't works
def convert_temp(temperature,input_scale:,output_scale:'celsius') if input_scale=='celsius' if output_scale=='kelvin'
elsif input_scale=='kelvin'
elsif input_scale=='fahrenheit'
end end
puts convert_temp(0, input_scale: 'celsius', output_scale: 'kelvin')
Using Ruby Symbols and Lambdas to get a readable table of conversions.