Question: c ) Rewrite using list comprehensions and filter. Hint: you can nest list comprehen - sions ( use one inside another ) . Yes, this

c) Rewrite using list comprehensions and filter. Hint: you can nest list comprehen- sions (use one inside another). Yes, this will be much easier with numpy arrays, but we are
not doing that yet. The intent here is to practice with list comprehensions so solutions using numpy will be graded as incorrect. [7pts]
x= list(range(101))
y= list(range(101))
z= list(range(101))
for i in range(101):
x[i]=x[i]**0.01
y[i]=y[i]**0.01
z[i]=z[i]**0.01
rho =[]
s=0.
for k in range(101):
rho = rho +[?]
for j in range(101):
[k]=[k]+[?]
for i in range(101):
(y[j]-0.5)****2+1
(z[k]-0.5)****2
if rho[k][j][i]>0.5:
s=s+[k][j][i]
 c) Rewrite using list comprehensions and filter. Hint: you can nest

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!