Skip to content

Instantly share code, notes, and snippets.

@harshildarji
Created December 10, 2018 19:00
Show Gist options
  • Select an option

  • Save harshildarji/23f30d66bd95e2f93591a32389a3ecd2 to your computer and use it in GitHub Desktop.

Select an option

Save harshildarji/23f30d66bd95e2f93591a32389a3ecd2 to your computer and use it in GitHub Desktop.
Find the total number of people in Prof. Boolean's workforce.
'''
Professor Boolean is an evil villain who is up to no good.
It is your job to help bring her down. The is a gang working under her.
The chain of command of the gang is structured in such a way that each leader has 7 people working directly under him/her.
Your task is to find the total number of people in Prof. Boolean's workforce given the number of level of hierarchy.
'''
levels = int(input('Number of level(s): '))
peoples = 1
for i in range(levels):
peoples += (7 ** (i + 1))
print('Number of people: {}'.format(peoples))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment