Which of the following statements would tell you that a function is not a procedure? for index in range(0, 3) print("Ask again later.") t = random.radiant(1, 4) return(q)
actually not sure about this one @SmokeyBrown would you mind taking a look at this
Though they can often be used to accomplish the same tasks, there are several subtle but important differences between functions and procedures, which determine what they can and cannot do. This article lists the main differences between the two: https://www.geeksforgeeks.org/difference-between-function-and-procedure/ For this question, I think the 7th item in that list--regarding return statements--is the most relevant for this question. I also think the fourth option in the question "return(q)" is written kind of strangely. I would expect something more like "return q" without the parentheses. I'm not sure exactly why this would cause confusion in the code between function and procedure, but it is a small discrepancy that stood out to me. All that to say, I think the last option is the strongest answer. It's just a guess from me, but I'm about 60% confident in my guess.
Hmmm ok thanks
If it's not the last option, then I think it would be the third option. In fact, depending on the context "return(q)" is a perfectly fine way to write a return statement. Actually, I did a quick search and it seems like "radiant" isn't a built-in function of "random." Maybe that's supposed to be the cause of the error? I've changed my mind from what I said earlier. I now think the third option is better than the fourth option. I am pretty confident that it's not either of the first two though
Ok thanks so much for the explanation it helped me a lot
C.) was wrong
That's interesting. I guess by process of elimination, the answer would be D. But I have to admit I'm still not entirely sure I understand why
Hmmm same imma try again and pick D.)
Join our real-time social learning platform and learn together with your friends!