Computer Science, asked by agarwalnaveen75, 9 months ago

def count_users(group):
count = 0
for member in get_members(group):
count += 1
if is_group(member):
count += count_users(member)
return count

print(count_users("sales")) # Should be 3
print(count_users("engineering")) # Should be 8
print(count_users("everyone")) # Should be 18

Answers

Answered by shahil2k10
0

Answer:

print(count_users("sales")) # Should be 3

print(count_users("engineering")) answer

Answered by Keerthana2812
9

Answer:

def count_users(group):

 count = 0

 for member in get_members(group):

   

   if is_group(member):

     count += count_users(member)

   else :

     count += 1  

 return count

print(count_users("sales")) # Should be 3

print(count_users("engineering")) # Should be 8

print(count_users("everyone")) # Should be 18

Explanation:

Similar questions