Operators Flashcards

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

+

A

add

2 +4 = 6

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

+

A

add

2 +4 = 6

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

-

A

subtract

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

*

A

multiply

2 *4 = 8

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

**

A

power of

2**4 = 16

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

/

A

Divide

2/4.0 == 0.5

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

%

A

modulus

2 % 4 ==2

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

.

A

Dot access

“1”.to_i == 1

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

::

A

Colon access

Module::Class

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

[]

A

list brackets

[1,2,3]

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

!

A

not

!true == false

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

less than

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

>

A

greater than

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

> =

A

greater than or equal to

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

<=

A

less than or equal to

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

<=>

A

comparison

4 <=> 4 == 0

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

==

A

equal

4 =4 = true

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

===

A

Equality

4 ===4 = true

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

!=

A

not equal

4 != 4 = false

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

&&

A
Locical and (higher precedence)
true &amp;&amp; false = false
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

||

A
Logical or (higher precedence)
true || flash = true
22
Q

..

A
range inclusive 
(0..3).to_a = [0,1,2,3]
23
Q

A

Range non inclusive

(0…3).to_a = [0,1,2]

24
Q

@

A

Object scope

@var ; @@classvar

25
Q

@@

A

Class scope

@var ; @@classvar

26
Q

$

A

global scope

$stdin

27
Q

-

A

subtract

28
Q

*

A

multiply

2 *4 = 8

29
Q

**

A

power of

2**4 = 16

30
Q

/

A

Divide

2/4.0 == 0.5

31
Q

%

A

modulus

2 % 4 ==2

32
Q

.

A

Dot access

“1”.to_i == 1

33
Q

::

A

Colon access

Module::Class

34
Q

[]

A

list brackets

[1,2,3]

35
Q

!

A

not

!true == false

36
Q

A

less than

37
Q

>

A

greater than

38
Q

> =

A

greater than or equal to

39
Q

<=

A

less than or equal to

40
Q

<=>

A

comparison

4 <=> 4 == 0

41
Q

==

A

equal

4 =4 = true

42
Q

===

A

Equality

4 ===4 = true

43
Q

!=

A

not equal

4 != 4 = false

44
Q

&&

A
Locical and (higher precedence)
true &amp;&amp; false = false
45
Q

||

A
Logical or (higher precedence)
true || flash = true
46
Q

..

A
range inclusive 
(0..3).to_a = [0,1,2,3]
47
Q

A

Range non inclusive

(0…3).to_a = [0,1,2]

48
Q

@

A

Object scope

@var ; @@classvar

49
Q

@@

A

Class scope

@var ; @@classvar

50
Q

$

A

global scope

$stdin