As it is now, we have to guess what is not working. Can you describe how they perform differently? Does one have a syntax error (which you should include), or do they both run. If they both run, what are the inputs that show the difference?
Line 7 on the first one is has a different indentation from the later portions which prevents it from running. But I'm not sure if that's your real problem or just a typo from when you pasted it in.
Line 7 on the first one is has a different indentation from the later portions which prevents it from running. But I'm not sure if that's your real problem or just a typo from when you pasted it in.