0

I am really really close to completing pset/dna. But there seems to be some problem in the 'if statement'. Somebody please guide. Before the line of underscores in the terminal, I have printed the value of STRs as calculated by my code. After the line, as you can see in the code, I am comparing my observation values with the values of individuals of the database, but it's not working in the desirable way. I'm missing something i guess. PS. Answer of this particular test case should be Bob.

enter image description here enter image description here

1
  • Please post the complete file as text. This would allow someone to more thoroughly understand your code. One thing to watch for is the string '2' is not equal to the number 2.
    – juls
    Apr 7 at 0:29
0

Your observation[key] is an integer. row[key] is a string. When you do observation[key] != row[key], (In this case 4 != '4')it will be true, breaking the loop.

So to fix this issue, do observation[key] != int(row[key])

1
  • Yes, it's working, thanks for your help! Apr 22 at 9:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .