Ask your own question, for FREE!
Computer Science 27 Online
kekeman:

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)

Vocaloid:

actually not sure about this one @SmokeyBrown would you mind taking a look at this

SmokeyBrown:

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.

kekeman:

Hmmm ok thanks

SmokeyBrown:

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

kekeman:

Ok thanks so much for the explanation it helped me a lot

kekeman:

C.) was wrong

SmokeyBrown:

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

kekeman:

Hmmm same imma try again and pick D.)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
kingsston: dose anyone wanna vc?
24 seconds ago 1 Reply 0 Medals
745967: need help
22 hours ago 7 Replies 1 Medal
Twaylor: How does this illusion work :/
1 day ago 6 Replies 0 Medals
Twaylor: Why does pride month exist?
1 day ago 22 Replies 2 Medals
CrumbCrumbington: photo dump
2 days ago 10 Replies 1 Medal
Twaylor: How did QuestionCove come to be? was it a school project?
6 days ago 4 Replies 5 Medals
imbored0wannatalk: i made sum collages what should i make some of next
22 hours ago 30 Replies 4 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!