0
House prices question bug
Hi I cant get the certification because of a bug in this question, I answered it in many ways that worked for me on Python in my computer And it doesnt seem to work anyway.
5 Answers
+ 1
My code passed the House Prices task, so it seems unlikely there is a bug in the question/answer. May we see what you tried so we can help?
+ 1
Miri Avraham the only issue in the code is that count is not initialized before the loop. Insert count=0 and then the program should pass the test!
+ 1
Thank you!
0
import numpy as np
data = np.array([150000, 125000, 320000, 540000, 200000, 120000, 160000, 230000, 280000, 290000, 300000, 500000, 420000, 100000, 150000, 280000])
avg=np.mean(data)
std=np.std(data)
sum=np.size(data)
for i in data:
if i>(avg-std) and i<(avg+std):
count+=1
result = (count/sum)*100
print(result)
0
I wrote my code(up here)
Would like your review,
Thanks