2016-12-24 21 views
1

我面臨着以下問題:布爾邏輯演習設置

Set each variable to true or false depending on what value you expect the expression to return no quotes around true and false.

的代碼看起來是這樣的:

# test_1 = 77 != 77 
test_1 = is/true 77 != 77 

# test_2 = -4 <= -4 
test_2 = is/true -4 <= -4 

# test_3 = true -44 < -33 
test_3 = is/true -44 <-33 

# test_4 = false100 == 1000 
test_4 = is/true 100 <= 1000 

我不斷收到此語法錯誤:

unexpected integer expecting $end 

我對Ruby完全陌生。任何幫助是極大的讚賞。

回答

0

你真正需要的是

test_1 = 77 != 77 # false 
test_2 = -4 <= -4 # true 
test_3 = -44 <-33 # true 
test_4 = 100 <= 1000 # true 

的「是/真」後=唱歌是給你的錯誤只是刪除這一點,它應該只是罰款

+0

非常感謝你MZaragoza它不說現在的語法錯誤,它說test_4的值是不正確的,在終端裏面只是說真的 – user7336724

+0

我剛剛得到它很高興測試4更改<=爲==,它現在的作品謝謝你喲非常感謝幫助我 – user7336724

+0

:)很高興能夠提供幫助 – MZaragoza