Error in evaluating homework 3.3 & 3.4

 0 With all possible inputs & conditions I'm getting the expected outputs. Still for both the questions of homework 3.3 & 3.4 its showing answer incorrect, though its output answer is correct. When submitting 3.3 the output is --> "Incorrect. Your procedure did not return the correct value for a list of one element." though its returning correct value for one element list. And the error for 3.4 is --> "Incorrect. Your procedure did not return the correct value for an empty list." though the procedure returns Zero for an empty list. please do clarify this problem. # Code for 3.3 def product_list(n): product = 1 length = len(n) while length != 0: num = n.pop() product = num * product length = length - 1 print product product_list([1,2,3,6]) # Code for 3.4 def greatest(p): max = 0 for e in p: if e > max: max = e print max greatest([1,5,3,9,4,9,10,2,4])  asked 16 Mar '12, 02:08 Abulize 0●1●2 accept rate: 0% Anton Golov ♦ 13.6k●21●75●174 This was the answer I submitted for 3.4 and got graded as wrong when submitted. Please do point out the mistake if any. (16 Mar '12, 02:25) Abulize

 1 It looks like the problem with 3.3 is that it doesn't "return" the value of the product. In fact, if you print "product_list([1,2,3,6])" from the calling procedure, you'll find that it has the value "None" answered 16 Mar '12, 02:24 Alan Kirschbaum 1.1k●1●6●26 k.thanx. Now i got ma mistake. Would have put return instead of print in both the answers. (16 Mar '12, 02:28) Abulize
 0 See my answer above for 3.3. Same thing for 3.4 In addition, your code within the definition block needs to be indented (you probably did this, but it doesn't show up in the code snip that you posted.) answered 16 Mar '12, 02:31 Alan Kirschbaum 1.1k●1●6●26
 0 The question asked for a procedure to return the greatest number in the list. You printed it. As venturaeagle said your indentation is wrong but I assume it is through the posting. answered 16 Mar '12, 07:00 Michael Button 1.4k●2●7●31
Question text:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

×27,848
×1,796
×45
×34