It's not immediately clear why if number == (7 || 13) is preferred to number == (7 || 13) in this explanation:
"If you read number == (7 || 13) like English, you might think it
means "Number is equal to 7 or 13". However, Ruby will not interpret
your program this way. Instead, by writing 7 || 13, Ruby will ask if
one of these is true. That's not what you want: you want to use ||
to connect two logical statements like (number == 7) and (number == 13)."
It's not immediately clear why if number == (7 || 13) is preferred to number == (7 || 13) in this explanation:
"If you read
number == (7 || 13)
like English, you might think it means "Number is equal to 7 or 13". However, Ruby will not interpret your program this way. Instead, by writing7 || 13
, Ruby will ask if one of these istrue
. That's not what you want: you want to use||
to connect two logical statements like(number == 7)
and(number == 13)
."