)
Consider the following Python function.
def mystery(l):
if l == []:
return(l)
else:
return(mystery(l[1:])+l[:1])
What does mystery([22,14,19,65,82,55]) return?
2) What is the value of pairs after the following assignment?
pairs = [ (x,y) for x in range(4,1,-1) for y in range(5,1,-1) if (x+y)%3 == 0 ]
3) Consider the following dictionary.
wickets = {"Tests":{"Kumble":[3,5,2,3],"Srinath":[4,4,1,0],"Prasad":[2,1,7,4]},"ODI":{"Kumble":[2,0],"Srinath":[1,2]}}
Which of the following statements does not generate an error?
wickets["ODI"]["Prasad"][0:] = [4,4]
wickets["ODI"]["Prasad"].extend([4,4])
wickets["ODI"]["Prasad"] = [4,4]
wickets["ODI"]["Prasad"] = wickets["ODI"]["Prasad"] + [4,4]
1
Expert's answer
2020-10-13T08:49:05-0400
Dear SOWMIYA, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment