puts 1 < 2 ? "One is less than two" : "not"
You changed an if
into an if/else
. They ask to refactor the code, not change its logical structure.
nevermind, was using ternary instead of one-liners
So what is it meant to be?
puts βwordsβ if truebooleanstatement
Make some substitutions to that and you should be good to go @sherifeji
yeah so what does it mean
As @arjofocolovi said I originally put an else statement rather than just using an if statement.
What @luminaire is showing is the structure of a one line if statement. as an example
puts "6 is less than ten!" if 6 < 10
puts is the action that Ruby will take if the βifβ statement is true. Anyting in ββ will be printed using puts. Then we use the βifβ to add a condition to print β6 is less than ten!β.
I could of confused you more but i hope it helps haha
okay thank you for the help.
I did:
puts βOne is less than two.β if 1 < 2
It keeps giving me the error: Oops, try again. Make sure your βifβ statement still has the same behavior. It should puts βOne is less than two!β
I found me problem. Why does it have to be so picky?
You should add β!β to the end of yours puts:
puts 1 < 2 ? βOne is less than two!β : βnotβ