Booleans Flashcards

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

What is a boolean?

A

A boolean is a data type value which is either true or false.

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

True or False Value: 0

A

True

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

True or False Value: “”

A

True

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

True or False Value: [ ]

A

True

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

True or False Value: “hello”

A

True

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

True or False Value: nil

A

False

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

True or False Value: 2.3

A

True

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

True or False Value: true

A

True

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

True or False Value: TRUE

A

True

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

True or False Value: false

A

False

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

True or False Value: FALSE

A

False

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

True or False Value: [1,2]

A

True

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

True or False Value: {:greeting => “hi”}

A

True

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

True or False Value: !true

A

False

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

True or False Value: !false

A

True

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

True or False Value: !!”pizza”

A

True

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

True or False Value: !!nil

A

False

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

True or False Value: true && true

A

True

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

True or False Value: true && false

A

False

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

True or False Value: false && false

A

False

21
Q

True or False Value: true || true

A

True

22
Q

True or False Value: true || false

A

True

23
Q

True or False Value: false || false

A

False

24
Q

True or False Value: 3 == 3

A

True

25
Q

True or False Value: 5 == 6

A

False

26
Q

True or False Value: “hello” == “hello”

A

True

27
Q

True or False Value: 15 == 15 || 10 != 12

A

True

28
Q

True or False Value: 5 == 5 && 12 == 10

A

False

29
Q

True or False Value: true && 8 == 8

A

True

30
Q

True or False Value: true || 4 == 4

A

True

31
Q

True or False Value: false && 8 != 8

A

False

32
Q

True or False Value: “taco” == “tacos”

A

False

33
Q

True or False Value: “taco” != “tacos”

A

True

34
Q

True or False Value: 8 != 2 && 20 == 10

A

False

35
Q

True or False Value: “boolean” == 1

A

False

36
Q

True or False Value: !(true && false)

A

True

37
Q

True or False Value: !(1000 == 1 || 10000 == 10000)

A

False

38
Q

True or False Value: !(10 == 10 && 20 != 10)

A

False

39
Q

True or False Value: !(1 != 100 || 30 == 40)

A

False

40
Q

True or False Value: !(“boolean” == “booleans” && “Code” == “Fun”)

A

True

41
Q

True or False Value: 1 == 1 && (!(“boolean” == 1 || 1 == 0))

A

True

42
Q

True or False Value: “strong” == “coffee” && (!(30 == 40 || 30 == 30))

A

False

43
Q

True or False Value: 30 == 30 && (!(“boolean” == “booleans” || “Coding” == “Awesome”))

A

True

44
Q

True or False Value: 14 > 3

A

True

45
Q

True or False Value: “yellow” == “yellow”

A

True

46
Q

my_mood = “happy”

True or False Value: my_mood == “happy”

A

True

47
Q

easter_eggs = 16
ducklings = 3
True or False Value: easter_eggs > ducklings

A

True

48
Q

easter_eggs = 16
ducklings = 3
True or False Value: ducklings >= easter_eggs

A

False

49
Q

easter_eggs = 16
ducklings = 3
True or False Value: ducklings == easter_eggs

A

False