Quiz on Filtering Data

Test yourself on filtering data.

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')

Question 1 of 40 attempted

Get hands-on with 1200+ tech skills courses.