Logo
Explore Help
Register Sign In
exercism/python
1
0
Fork 0
You've already forked python
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
95f25cf279ed2c5cb3256484cfae6d6bceff337c
python/exercises/practice/pop-count/.meta/example.py

7 lines
146 B
Python
Raw Normal View History

feat: add pop-count exercise (#3518) * feat: add pop-count practice exercise * config: del house, protein-trans from syllabus As pop-count was added to the loop concept, house and protein translation were removed to keep the tree lean. * Update config.json On second (and third) thought, let's put pop-count first -- ahead of saddle points and OCR. Feels like a better progression that way. --------- Co-authored-by: BethanyG <BethanyG@users.noreply.github.com>
2023-10-18 15:50:52 +02:00
def egg_count(display_value):
eggs = 0
while display_value:
eggs += display_value % 2
display_value //= 2
return eggs
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 75ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API