![]() | Section 7.4 A little bit of logic |
|
13 May 2012, 12:30
John McCormack (3 posts) |
Hi, i_am_chris = true I’m not clear on what the && operaror is doing. The confusion stems from the 2nd & 3rd lines: puts i_like_beer && i_eat_rocks I’m reading one of them as true && false, and the other as false && true, but I don’t understand why the result for both of them is false. |
|
15 May 2012, 19:42
Dave Thomas (231 posts) |
For an && expression to be true overall, both parts must be true. I’m happy if I’m well rested AND I’m well fed I’m only happy if both are true. |
|
16 May 2012, 08:00
John McCormack (3 posts) |
I get it now, thanks Dave. |
| You must be logged in to comment |

