Consider the following function:
def pr(a):
for c in a:
print(c, c, end=" ")The result of calling this function with a particular string
a is C C S S C C E E Y Y E E. What was
a?
What does the following program print?
def fl(tu):
r = ""
for v in tu:
r += str(v + v)
return r
print(fl(("A", "C", 3)))Suppose s = "Winter is cold." Which of the following
evaluates to "r"?
s[5]s(5)s[6]s(6)Suppose last_name = "Wehrwein". Which of the
following evaluates to "in"? List all that apply.
last_name[7:8]last_name[-2:8]last_name[6:-1]last_name[-3:]last_name[6:]Which of the following evaluates to the last character of a
string s?
s[len(s) - 1]s[len(s)]s[len(s) + 1]s[42]Suppose last_name = "wehrwein". For which of the
following a and b will
last_name[a] == last_name[b] evaluate to True?
List all that apply.
a = 1, b = 5a = 1, b = 7a = 8, b = -4a = -2, b = -6What does the following code print?
m = (4, 1, 2, 2, 2)
s = "Scott"
for i in range(len(s)):
print(s[i] * m[i], end="")Consider the following function:
def flop(value, number):
output = ""
for i in range(number, 0, -1):
output = output + value[i-1]
for i in range(number, len(value)):
output = output + value[i]
return outputSuppose a contains an integer. Which of the following
are possible return values of the following call:
flop("no time", a)List all that apply:
mit onenomitet onimeon timeemit ontimeno time