# Quizz 3.24 Notes and Grading Program potential Problem.

 0 Hello, just to say if I understand this wrong, if you ask me for write a procedure that produces an output i will write this code: def myprocedure(): print "Hello!"  But if you ask me to write a procedure that returns a value I will write def myprocedure(): return "Hello"  I want to write about this because in the Quizz 3.24 it says: #Define a procedure, sum_list, #that takes as its input a #List of numbers, and produces #as its output the sum of all  So i wrote my procedure just printing out the result of the sum of the list, not returning it, just to follow those instructions, but something happened when I tried to submit my code, that was, Try Again! I this the way grading program is evaluating our code hence marking it as incorrect? The question is, an output is to print out any value to the screen or an output is return a value?, or both?, in that case how could you realize which one is different? Just a Question, tell me if I'm wrong. asked 09 Mar '12, 17:44 Steven Sierr... 946●9●23●41 accept rate: 10%

 1 Output is to return the value. Print is to print. That one wants you to return the value. answered 09 Mar '12, 17:54 fnenu-1 ♦♦ 18.5k●19●81●231 Okay could make a poll and realize that most of the people say that an output is to return a value, but there comes the question, because some of the homeworks you could be asked to ouput a value meaning to print it out on the screen. Just to spread this misunderstood concept, from here everything asked to be and output, will be a procedure that return something. (09 Mar '12, 18:04) Steven Sierr... As @Uplink says, the way it's been talked about in this course is in terms of input-output where output is return, and print is something else. I think the whole concept of return and print hasn't been understood by a lot of people. (09 Mar '12, 18:17) fnenu-1 ♦♦
 0 Hmmm, A procedure that returns a value has much more potential than one that just prints something out. You can assign the returned value to variable and then do some more manipulation. Like you might use it to generate an average etc. I think you can safely say that when one mentions the output of a procedure it is the value that is returned. answered 09 Mar '12, 18:00 Marlen Waaijer 107●7
 0 If you rewind to the video that introduced procedures, you'll see that a procedure "takes inputs and produces outputs", or something to that effect. You'll notice a certain mathematical taint in the classes. In programming terms, they should say "the procedure returns this and that" rather than "produces outputs". Once you realise this little bias, it gets easier. answered 09 Mar '12, 18:06 Uplink 478●2●4●15
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

×15,329
×684
×33
×21
×5