logo

Crowdly

How many times will the marked line in the following code run when the input int...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

How many times will the marked line in the following code run when the input integer is n?

def mystery(n):

stamp = 0

if n <= 0:

return 0

else:

for i in range(n):

for j in range(n):

stamp += j # This line

return stamp

Answer in terms of n

100%
0%
0%
0%
More questions like this

Want instant access to all verified answers on learning.monash.edu?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!