Quiz on Filtering Data

Test yourself on filtering data.

We'll cover the following...

Quiz: Filtering Data

1.

What is the equivalent expression for print_it(‘caps’, ‘chicago’) given the functions below?

def print_low(val):
    print(val.lower())

def print_caps(val):
    print(val.upper())

def print_it(key, val):
     my_dict = {'lower': print_low, 'caps': print_caps}
     my_dict[key](val)
A.

print_it('chicago')

B.

print_caps['chicago']

C.

print_caps('chicago')

D.

print_it['caps']('chicago')


1 / 4