Logical Operators Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

and

A

Called Logical AND operator. If both the operands are true then then condition becomes true.
ex.
(a and b) is true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

or

A

Called Logical AND operator. If both the operands are true then then condition becomes true.
ex.
(a or b) is true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

&&

A

Called Logical AND operator. If both the operands are non zero then then condition becomes true.
(a && b) is true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

||

A

Called Logical OR Operator. If any of the two operands are non zero then then condition becomes true.
ex.
(a || b) is true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

!

A

Called Logical NOT Operator. Use to reverses the logical state of its operand. If a condition is true then Logical NOT operator will make false.
ex.
!(a && b) is false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

not

A

Called Logical NOT Operator. Use to reverses the logical state of its operand. If a condition is true then Logical NOT operator will make false.
ex.
not(a && b) is false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

?:

A

Ternary operator
If Condition is true ? Then value X : Otherwise value Y

ex.
a = true ? ‘a’ : ‘b’ #=> “a”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

..

A

Creates a range from start point to end point inclusive
ex.
1..10 Creates a range from 1 to 10 inclusive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A

Creates a range from start point to end point exclusive

1…10 Creates a range from 1 to 9

How well did you know this?
1
Not at all
2
3
4
5
Perfectly