Control Flow in Ruby - Dare to Compare


#1

I'm stuck on the true or false thing because I've done what I had to do but it tells me I haven't done the expression after each =!......

Please help me its confusing


#2

Please give your code so that we can try to help.


#3

TRUE and FALSE are case sensitive...that was my problem


#4

please help I can figure this one out

test_1 should be false

test_1 = 10 < 8 // false

test_2 = should be false

test_2 = 8 == 10 // false

test_3 = should be true

test_3 = 8 != 10 // true


#5

Okay thank you for helping me its really confusing


#6

8 == 10 // false
test_1 =! false

8 > 10 // false
test_2 =! false

8 =! 10 // true
test_3 =! true


#7

First of all, why do you use these:

// 
// 
//

These are not Ruby code and are not Ruby comments either, they won't allow you to run your code.

Also, this operator =! will not allow you to assign a value to a variable. You need the operator = instead.


#8

I did what you told me and then it said Oops, try again. Make sure to put an expression after each =!


#9

Post your new code, because if it's telling you that, it's likely that you didn't remove the problematic operator.


#10

I had the same error of you. Read againd the explanation and put this code and went all correct!

test_1 should be false

test_1 = 8>10

test_2 = should be false

test_2 = 8 == 10

test_3 = should be true

test_3 = 10 > 8


#11

Thank you so much :wink: :smile:


#12

You got the exclaimation mark on the wrong side btw.
It should be:

!=

not

=!

#13

Thanks luyangliu1, I've been stuck on it for a while :relieved:


#14

I am having an issue on this prcatcie
below is my code but I receive error Oops, try again. Make sure to put an expression after each =!
and (ruby):5: unterminated regexp meets end of file
someone please tell me what is wrong with my code

test_1 should be true

test_1 = (9==9) && (100==100) // true

test_2 = should be true

test_2 = (45==35) || (400==300) // true

test_3 = should be false

test_3 = !(21==21) || (6==7) // false