15/20 why isnt this correct?


#1

puts 1 < 2 ? "One is less than two" : "not"

#2

You changed an if into an if/else. They ask to refactor the code, not change its logical structure.


#3

nevermind, was using ternary instead of one-liners


#4

So what is it meant to be?


#6

puts "words" if truebooleanstatement

Make some substitutions to that and you should be good to go @sherifeji


#9

yeah so what does it mean


#10

@abergeron

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


#11

okay thank you for the help.


#12

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!'


#13

I found me problem. Why does it have to be so picky?


#14

You should add "!" to the end of yours puts:
puts 1 < 2 ? "One is less than two!" : "not"