Booleans Flashcards
What is a boolean?
A boolean is a data type value which is either true or false.
True or False Value: 0
True
True or False Value: “”
True
True or False Value: [ ]
True
True or False Value: “hello”
True
True or False Value: nil
False
True or False Value: 2.3
True
True or False Value: true
True
True or False Value: TRUE
True
True or False Value: false
False
True or False Value: FALSE
False
True or False Value: [1,2]
True
True or False Value: {:greeting => “hi”}
True
True or False Value: !true
False
True or False Value: !false
True
True or False Value: !!”pizza”
True
True or False Value: !!nil
False
True or False Value: true && true
True
True or False Value: true && false
False
True or False Value: false && false
False
True or False Value: true || true
True
True or False Value: true || false
True
True or False Value: false || false
False
True or False Value: 3 == 3
True
True or False Value: 5 == 6
False
True or False Value: “hello” == “hello”
True
True or False Value: 15 == 15 || 10 != 12
True
True or False Value: 5 == 5 && 12 == 10
False
True or False Value: true && 8 == 8
True
True or False Value: true || 4 == 4
True
True or False Value: false && 8 != 8
False
True or False Value: “taco” == “tacos”
False
True or False Value: “taco” != “tacos”
True
True or False Value: 8 != 2 && 20 == 10
False
True or False Value: “boolean” == 1
False
True or False Value: !(true && false)
True
True or False Value: !(1000 == 1 || 10000 == 10000)
False
True or False Value: !(10 == 10 && 20 != 10)
False
True or False Value: !(1 != 100 || 30 == 40)
False
True or False Value: !(“boolean” == “booleans” && “Code” == “Fun”)
True
True or False Value: 1 == 1 && (!(“boolean” == 1 || 1 == 0))
True
True or False Value: “strong” == “coffee” && (!(30 == 40 || 30 == 30))
False
True or False Value: 30 == 30 && (!(“boolean” == “booleans” || “Coding” == “Awesome”))
True
True or False Value: 14 > 3
True
True or False Value: “yellow” == “yellow”
True
my_mood = “happy”
True or False Value: my_mood == “happy”
True
easter_eggs = 16
ducklings = 3
True or False Value: easter_eggs > ducklings
True
easter_eggs = 16
ducklings = 3
True or False Value: ducklings >= easter_eggs
False
easter_eggs = 16
ducklings = 3
True or False Value: ducklings == easter_eggs
False