Walmart Labs Interview Question | Dictionary
Question
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
It will take less than 1 minute to register for lifetime. Bonus Tip - We don't send OTP to your email id Make Sure to use your own email id for free books and giveaways
Answer ( 1 )
def std(j):
temp=0
s,l=0,len(j)
for val in j:
s=s+val
mean=s/l
for val in j:
temp+=(val-mean)**2
temp=temp/l
return temp
def ans(p):
q={}
for i,j in p.items():
q[i]=std(j)
return q
if __name__==’__main__’:
p={1:[1,2,3,4],5:[5,9,19,10]}
l=ans(p)
print(l)