{"id":26678254,"url":"https://github.com/csaba79-coder/seti-python-practice","last_synced_at":"2026-07-03T14:02:10.579Z","repository":{"id":108981725,"uuid":"355257968","full_name":"Csaba79-coder/SETI-python-practice","owner":"Csaba79-coder","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-06T16:29:40.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-29T22:38:07.376Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Csaba79-coder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-04-06T16:28:45.000Z","updated_at":"2021-04-06T16:29:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"b894838e-c72e-4822-9b0c-1d12ab05b5a8","html_url":"https://github.com/Csaba79-coder/SETI-python-practice","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Csaba79-coder/SETI-python-practice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Csaba79-coder%2FSETI-python-practice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Csaba79-coder%2FSETI-python-practice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Csaba79-coder%2FSETI-python-practice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Csaba79-coder%2FSETI-python-practice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Csaba79-coder","download_url":"https://codeload.github.com/Csaba79-coder/SETI-python-practice/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Csaba79-coder%2FSETI-python-practice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35088478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-03T02:00:05.635Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-26T05:15:18.143Z","updated_at":"2026-07-03T14:02:10.564Z","avatar_url":"https://github.com/Csaba79-coder.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SETI\n\n## Story\n\nThe SETI initiative proved to be successful in the first decades of 21st century:\nwe found another intelligent species out there, and following the first lead,\nwe met many others in the Universe. A dedicated UN organization started to\ncommunicate with our new neighbors regularly.\n\nAs a developer working for the program for extraterrestrial communications, you\noften have to work with other scientists to help them decode the latest messages\nfrom the conversations between our numerous alien neighbors like the Hexacats or\nthe Septatigers.\n\nOne of their latest conversations includes a talk about the universal constant\nfor the theory of everything. Unlike us, who use 10 as the base system (and 60\nand sometimes 12), the Hexacats have 16 tentacles, so they use 16 as their\nnumber base system and the Septatigers have seven talons, so they use 7 as\nthe base. To understand their numbers, we have to convert them to the\ndecimal format.\n\nYour task for today is to create a reliable system that converts any number from\na base system to another. Start with the specialized functions converting\nbetween decimal and binary since these are the main tools to encode our messages\nand communicate via computers.\n\n## What are you going to learn?\n\nYou will learn about number bases and their role in programming.\n\n## Tasks\n\n1. Implement the `decimal_to_binary(decimal_number)` function that converts numbers from base 10 to base 2\n    - The function returns a list containing only zeros and ones\n    - The returned list of digits represent the binary representation of the input E.g. if the decimal input is `20`, the output is `[1, 0, 1, 0, 0]`\n\n2. Implement the `binary_to_decimal(binary_digits)` function that converts numbers from base 2 to base 10 integers\n    - The function returns an integer representing a decimal number\n    - The returned number is the decimal representation of the binary input, e.g. if the binary input is `[1, 0, 1, 0, 0]`, the output is `20`\n\n3. Implement the `decimal_to_base(decimal_number, destination_base)` function that converts numbers from base 10 to `destination_base`\n    - The function returns a list containing digits in the `destination_base`\n    - The returned list of digits represent the decimal input number in the `destination_base`, e.g. if the decimal input is `20` and `destination_base` is `8`, the output is `[2, 4]`\n\n4. Implement the `base_to_decimal(digits, original_base)` function that converts numbers from `original_base` to base 10\n    - The function returns an integer representing a decimal number\n    - The returned number is the decimal representation of the input in `original_base`, e.g. if the input is `[2, 4]` and `original_base` is `8`, the output is `20`\n\n5. Implement the `digits_as_string(digits, base)` function that converts a list of digits representing a number in `base` into a string representation\n    - The function returns a string where each digit in the list is mapped into a single character. Digits greater than 10 are represented by letters `A-F`\n    - Digits between 10 and 15 turn to letters `A-F`, smaller digits don't change in the string representation, e.g. if the input digits are `[2, 15, 9, 11]`, the output is `\"2F9B\"`\n    - When the input parameter `base` is greater than 16 the function raises a `ValueError` exception\n    - When one of the digits in the list is greater than `base`, the function should raise a `ValueError` exception\n\n6. Implement the `convert_base(original_digits, original_base, destination_base)` function that converts a list of digits given in `original_base` to digits in `destination_base`\n    - The function returns a list of digits in `destination_base`\n    - The function returns a list of digits representing the original number in `destination_base` E.g. if the digits are `[1, 1, 2, 0]`, `original_base` is `3` and  `destination_base` is `2`, the output is `[1, 0, 1, 0, 1, 0]`\n\n## General requirements\n\n- No built-in base conversion functions are used\n\n## Hints\n\n- For each of the functions, first try to understand the mathematical algorithm for\n  doing the conversion. The easiest way to do it is just to try it out on an example.\n- Verify yourself along the way by using an online resource like\n  [this one](https://www.rapidtables.com/convert/number/base-converter.html).\n- Python has builtin functions for some base conversions:\n  [`int(num, base)`](https://docs.python.org/3/library/functions.html?highlight=open#int),\n  [`bin(num)`](https://docs.python.org/3/library/functions.html?highlight=open#bin) or\n  [`hex(num)`](https://docs.python.org/3/library/functions.html?highlight=open#hex)\n  but **you must not use them during this project**.\n- The easiest solution for the `convert_base` function is to do the conversion\n  by going from `original_base` to decimal, and from decimal to `destination_base`,\n  calling the `base_to_decimal` and `decimal_to_base` functions in a chain.\n- As an advanced exercise, try to implement `convert_base` without going through\n  the decimal value!\n\n\n## Background materials\n\n- \u003ci class=\"far fa-exclamation\"\u003e\u003c/i\u003e [Binary, decimal and hexadecimal numbers](https://www.mathsisfun.com/binary-decimal-hexadecimal.html)\n- \u003ci class=\"far fa-exclamation\"\u003e\u003c/i\u003e [Number Conversion Algorithms](http://www.cs.trincoll.edu/~ram/cpsc110/inclass/conversions.html)\n- \u003ci class=\"far fa-video\"\u003e\u003c/i\u003e [Converting from decimal to binary](https://www.youtube.com/watch?v=H4BstqvgBow)\n- [Control structures](project/curriculum/materials/competencies/python-basics/python-control-structures.md.html)\n- [Functions](project/curriculum/materials/competencies/python-basics/python-functions.md.html)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsaba79-coder%2Fseti-python-practice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsaba79-coder%2Fseti-python-practice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsaba79-coder%2Fseti-python-practice/lists"}