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

Help Which of the following is an example of a subroutine? def pretty_print(x): print("++++", x, "++++") if x > 0: s = ( "pos") elif x < 0: s = ("neg") input("Enter your name: ") return s

SmokeyBrown:

As I understand it, the term "subroutine" is interchangeable with "function" or "method". And the only fully defined method is the first option, although the other options do form instructions that would be part of a function/subroutine/method. So, I would go with the first option for this one

kekeman:

Ok it says from my lessons Every time you define a new function, it is considered a subroutine.

kekeman:

So i agree!

SmokeyBrown:

Nice :)

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!
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!