Answer to Question #138180 in Python for SOWMIYA

Question #138180
)
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

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS