# Flashcards: 04-logic

**Front:** boolean

**Back:** A value that is only True or False, e.g. is_ready = True

---

**Front:** True

**Back:** print(True) shows True, always capitalized.

---

**Front:** False

**Back:** print(False) shows False; lowercase true gives a NameError.

---

**Front:** ==

**Back:** 5 == 5 asks a question and gives True; = stores, == asks.

---

**Front:** !=

**Back:** 5 != 3 gives True.

---

**Front:** >

**Back:** 5 > 3 gives True.

---

**Front:** <

**Back:** 3 < 5 gives True.

---

**Front:** >=

**Back:** age >= 10 is True when age is 10 or more.

---

**Front:** <=

**Back:** age <= 10 is True when age is 10 or less.

---

**Front:** if

**Back:** if age >= 10: runs its block only when the condition is true.

---

**Front:** else

**Back:** else covers every other case, with no condition of its own.

---

**Front:** elif

**Back:** elif chains choices in order; the first true condition wins.

---

**Front:** colon

**Back:** if age >= 10: ends with a colon.

---

**Front:** indentation

**Back:** An if block is indented four spaces; indent is meaning, not decoration.

---

**Front:** for

**Back:** for side in range(4): repeats its block once per item.

---

**Front:** range

**Back:** range(4) counts 0, 1, 2, 3; range(1, 4) counts 1, 2, 3.

---

**Front:** while

**Back:** while count > 0: repeats while its condition is true; change what it tests.

---

