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
0
Answer:
print(count_users("sales")) # Should be 3
print(count_users("engineering")) answer
Answered by
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
Accountancy,
5 months ago
History,
5 months ago
Accountancy,
5 months ago
Math,
10 months ago
Biology,
10 months ago
English,
1 year ago
Biology,
1 year ago