Ask your own question, for FREE!
Computer Science 7 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
HeyItsAlicia: Why was questioncove not working??
13 hours ago 2 Replies 1 Medal
Countless7Echos: Ah trying out the whole T.V girl drawing :p (I love drawing eyes)
23 hours ago 14 Replies 6 Medals
kaelynw: starting to draw a hand
3 days ago 17 Replies 2 Medals
Twaylor: Rate it :D (Took 2 days)
1 week ago 7 Replies 0 Medals
XShawtyX: Art, Short Writing Assignment: Imagining Landscapes
2 days ago 9 Replies 1 Medal
XShawtyX: Chemistry, Help ud83dude4fud83cudffe
1 week ago 13 Replies 1 Medal
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!