Python questions 1. How many return statements is a Python function allowed tohave? a) 0 b) 0
Question:
Python questions
1. How many return statements is a Python function allowed tohave?
a) 0
b) 0 or 1
c) 1
d) 1 or more
e) Any number
-----------------------------------------------------
2. Which statement best describes the effect of mystery onxs?
def mystery(xs):
for k in range(1,len(xs),2):
xs[k] = xs[k-1]
a) It duplicates the even-indexed elements of xs.
b) It duplicates the odd-indexed elements of xs.
c) It swaps adjacent elements of xs.
d) It copies the first element of xs into every other slot.
e) It copies the front half of xs into the back half.
-----------------------------------------------------------
3. In Python, the principal difference between a dictionary anda list is that
a) a list can store values of any type.
b) a dictionary stores values linearly.
c) a list accesses values by their position.
d) a dictionary validates entries before storing them.
e) a list can be mapped over
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill