# In[1]:
print("In[1]:")
x = True
print(x)
print(type(x), "\n")

# In[2]:
print("In[2]:")
def can_run_for_president(age):
    """Can someone of the given age run for president in the US?"""
    # The US Constitution says you must be at least 35 years old
    return age >= 35
print("Can a 19-year-old run for president?", can_run_for_president(19))
print("Can a 45-year-old run for president?", can_run_for_president(45), "\n")

# In[3 - 4]:
print("In[3-4]:")
print(3.0 == 3, "\n")

# In[5]:
print("In[5]:")
def is_odd(n):
    return (n % 2) == 1
print("Is 100 odd?", is_odd(100))
print("Is -1 odd?", is_odd(-1), "\n")

# In[6]:
print("In[6]:")
def can_run_for_president(age, is_natural_born_citizen):
    """Can someone of the given age and citizenship status run for president in the US?"""
    # The US Constitution says you must be a natural born citizen *and* at least 35 years old
    return is_natural_born_citizen and (age >= 35)
print(can_run_for_president(19, True))
print(can_run_for_president(55, False))
print(can_run_for_president(55, True), "\n")

# In[7]:
print("In[7]:")
print(True or True and False, "\n")

# In[8]:
print("In[8]:")
def inspect(x):
    if x == 0:
        print(x, "is zero")
    elif x > 0:
        print(x, "is positive")
    elif x < 0:
        print(x, "is negative")
    else:
        print(x, "is unlike anything I've ever seen...")

inspect(0)
inspect(-15)
print()

# In[9]:
print("In[9]:")
def f(x):
    if x > 0:
        print("Only printed when x is positive; x =", x)
        print("Also only printed when x is positive; x =", x)
    print("Always printed, regardless of x's value; x =", x)

f(1)
f(0)
print()

# In[10]:
print("In[10]:")
print(bool(1)) # all numbers are treated as true, except 0
print(bool(0))
print(bool("asf")) # all strings are treated as true, except the empty string ""
print(bool(""), "\n")
# Generally empty sequences (strings, lists, and other types we've yet to see like lists and tuples)
# are "falsey" and the rest are "truthy"

# In[11]:
print("In[11]:")
if 0:
    print(0)
elif "spam":
    print("spam")
# In[1]:
print("In[1]:")
x = True
print(x)
print(type(x), "\n")

# In[2]:
print("In[2]:")
def can_run_for_president(age):
    """Can someone of the given age run for president in the US?"""
    # The US Constitution says you must be at least 35 years old
    return age >= 35
print("Can a 19-year-old run for president?", can_run_for_president(19))
print("Can a 45-year-old run for president?", can_run_for_president(45), "\n")

# In[3 - 4]:
print("In[3-4]:")
print(3.0 == 3, "\n")

# In[5]:
print("In[5]:")
def is_odd(n):
    return (n % 2) == 1
print("Is 100 odd?", is_odd(100))
print("Is -1 odd?", is_odd(-1), "\n")

# In[6]:
print("In[6]:")
def can_run_for_president(age, is_natural_born_citizen):
    """Can someone of the given age and citizenship status run for president in the US?"""
    # The US Constitution says you must be a natural born citizen *and* at least 35 years old
    return is_natural_born_citizen and (age >= 35)
print(can_run_for_president(19, True))
print(can_run_for_president(55, False))
print(can_run_for_president(55, True), "\n")

# In[7]:
print("In[7]:")
print(True or True and False, "\n")

# In[8]:
print("In[8]:")
def inspect(x):
    if x == 0:
        print(x, "is zero")
    elif x > 0:
        print(x, "is positive")
    elif x < 0:
        print(x, "is negative")
    else:
        print(x, "is unlike anything I've ever seen...")

inspect(0)
inspect(-15)
print()

# In[9]:
print("In[9]:")
def f(x):
    if x > 0:
        print("Only printed when x is positive; x =", x)
        print("Also only printed when x is positive; x =", x)
    print("Always printed, regardless of x's value; x =", x)

f(1)
f(0)
print()

# In[10]:
print("In[10]:")
print(bool(1)) # all numbers are treated as true, except 0
print(bool(0))
print(bool("asf")) # all strings are treated as true, except the empty string ""
print(bool(""), "\n")
# Generally empty sequences (strings, lists, and other types we've yet to see like lists and tuples)
# are "falsey" and the rest are "truthy"

# In[11]:
print("In[11]:")
if 0:
    print(0)
elif "spam":
    print("spam")
# In[1]: # In[2]: Can someone of the given age run for president in the US? # The US Constitution says you must be at least 35 years old # In[3 - 4]: # In[5]: # In[6]: Can someone of the given age and citizenship status run for president in the US? # The US Constitution says you must be a natural born citizen *and* at least 35 years old # In[7]: # In[8]: # In[9]: # In[10]: # all numbers are treated as true, except 0 # all strings are treated as true, except the empty string "" # Generally empty sequences (strings, lists, and other types we've yet to see like lists and tuples) # are "falsey" and the rest are "truthy" # In[11]: