logo

Crowdly

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

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

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%
Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на learning.monash.edu?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!