Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[ 5 0 points ] Answer the following questions that require you to evaluate expressions or short code fragments. ( a ) Suppose L is

[50 points] Answer the following questions that require you to evaluate expressions or short code fragments.
(a) Suppose L is ["healthy", "join", "verity"]. What does the following expression evaluate to?
[x for x in L for y in x if y in [v,y]
(b) Suppose D is "class": 7,0,1, "thing": 3,1,4,"big": [1,1,9]. What is the value of D after the following code fragment is executed?
"big"][1]= "thing"
"big"][1]
(c) Suppose D is "what": 22, "are":11, "you":14, "doing":5, "next":9, "Saturday":4}. What is the value of D after the following code fragment is executed?
"what"] "are"]
D. update ({"Sunday": 25, "doing":7})
del "you"]
(d) What does this expression evaluate to?
for x in range (2,40) if
for y in range (2,x) if x%y==0 and
for y in range (2,x+2) if (x+2)%y==0
(e) Suppose L is "lettuce", "spinach"],[["parsley"]], "hello", [1,[2],[1,2]]]. What does this expression evaluate to?
sum (L[len(L)-1][2])*L[2].replace("lo","p")
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Bioinformatics Databases And Systems

Authors: Stanley I. Letovsky

1st Edition

1475784058, 978-1475784053

More Books

Students also viewed these Databases questions

Question

10. What is meant by a feed rate?

Answered: 1 week ago