{"id":21636093,"url":"https://github.com/ttafsir/100-days-of-code","last_synced_at":"2026-05-15T18:34:07.829Z","repository":{"id":98968806,"uuid":"357287165","full_name":"ttafsir/100-days-of-code","owner":"ttafsir","description":"Repository to track #100DaysOfCode challenge in Python","archived":false,"fork":false,"pushed_at":"2021-05-02T19:30:03.000Z","size":608,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-12T03:52:56.797Z","etag":null,"topics":["100daysofcode"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ttafsir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2021-04-12T17:47:16.000Z","updated_at":"2021-05-02T19:30:05.000Z","dependencies_parsed_at":"2023-07-03T05:36:59.280Z","dependency_job_id":null,"html_url":"https://github.com/ttafsir/100-days-of-code","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ttafsir/100-days-of-code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttafsir%2F100-days-of-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttafsir%2F100-days-of-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttafsir%2F100-days-of-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttafsir%2F100-days-of-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ttafsir","download_url":"https://codeload.github.com/ttafsir/100-days-of-code/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttafsir%2F100-days-of-code/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003414,"owners_count":26083582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"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":["100daysofcode"],"created_at":"2024-11-25T03:29:49.488Z","updated_at":"2025-10-10T09:51:15.949Z","avatar_url":"https://github.com/ttafsir.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 100 Days of Python Challenge\n\nRepo to track my progress over the next 100 days of Python challenges. This challenge is based on the [#100DaysOfCode in Python](https://training.talkpython.fm/courses/details/100-days-of-code-in-python) course and challenge from [talkpython.fm](talkpython.fm)\n\n:rocket: [Initial Repository](../../tree/737dea6bcb47f57880959065882255be102d09ea/) - Click here for the initial version of this repository.\n\n### The plan\n\n\u003cdetails\u003e\u003csummary\u003eDays 1-3: Playing with Datetimes\u003c/summary\u003e\n\n#### Day 1\n\n* Lecture: learning datetime and date (TalkPython)\n* Reading: [Using Python datetime to Work With Dates and Times](https://realpython.com/python-datetime/)\n* Code:\n  * [datetime shell exercises](./code/day1/day1_datetime.py)\n  * [fun exercise](./code/day1/pyramid.py)\n\n#### Day 2\n\n* Lecture: Datetime `timedelta` usage (TalkPython)\n* Code:\n  * [datetime shell exercises](./code/day2/day2_datetime.py)\n\n#### Day 3\n\n* Code:\n  * [pomodoro timer](./code/pomodoro.py)\n  * [logtime parser](./code/logtimes.py)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 4-6: Collections Module\u003c/summary\u003e\n\n#### Day 4\n\n* Lecture: Collections module (TalkPython)\n  *  Namedtuples\n  *  Defaultdicts\n  *  Counter\n  *  Deque\n\nThe `collections` module implements specialized container datatypes providing alternatives to Python’s general purpose built-in containers, [`dict`](https://docs.python.org/3/library/stdtypes.html#dict), [`list`](https://docs.python.org/3/library/stdtypes.html#list), [`set`](https://docs.python.org/3/library/stdtypes.html#set), and [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple).\n\n| [`namedtuple()`](https://docs.python.org/3/library/collections.html#collections.namedtuple) | factory function for creating tuple subclasses with named fields |\n| ------------------------------------------------------------ | ------------------------------------------------------------ |\n| [`deque`](https://docs.python.org/3/library/collections.html#collections.deque) | list-like container with fast appends and pops on either end |\n| [`ChainMap`](https://docs.python.org/3/library/collections.html#collections.ChainMap) | dict-like class for creating a single view of multiple mappings |\n| [`Counter`](https://docs.python.org/3/library/collections.html#collections.Counter) | dict subclass for counting hashable objects                  |\n| [`OrderedDict`](https://docs.python.org/3/library/collections.html#collections.OrderedDict) | dict subclass that remembers the order entries were added    |\n| [`defaultdict`](https://docs.python.org/3/library/collections.html#collections.defaultdict) | dict subclass that calls a factory function to supply missing values |\n| [`UserDict`](https://docs.python.org/3/library/collections.html#collections.UserDict) | wrapper around dictionary objects for easier dict subclassing |\n| [`UserList`](https://docs.python.org/3/library/collections.html#collections.UserList) | wrapper around list objects for easier list subclassing      |\n| [`UserString`](https://docs.python.org/3/library/collections.html#collections.UserString) | wrapper around string objects for easier string subclassing  |\n\n**`namedtuple`**\n\n```python\n\u003e\u003e\u003e from collections import namedtuple\n\u003e\u003e\u003e User = namedtuple('User', 'name role')\n\u003e\u003e\u003e user = User(name=\"Tafsir\", role=\"Architect\")\n\u003e\u003e\u003e user.name\n'Tafsir'\n\u003e\u003e\u003e user.role\n'Architect'\n\u003e\u003e\u003e\n```\n\n**`defaultdict`**\n\n```python\n\u003e\u003e\u003e scores = {\"player1\": 100, \"player2\": 75}\n\u003e\u003e\u003e scores[\"player3\"]\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nKeyError: 'player3'\n\u003e\u003e\u003e\n\u003e\u003e\u003e # using get to avoid KeyError\n\u003e\u003e\u003e scores.get(\"player3\")\n\u003e\u003e\u003e\n\u003e\u003e\u003e # assigning a value to non-existent key\n\u003e\u003e\u003e scores[\"player3\"] = 99\n\u003e\u003e\u003e scores[\"player4\"] = 99\n\u003e\u003e\u003e\n\u003e\u003e\u003e # assigning values while building a collection\n\u003e\u003e\u003e results = {}\n\u003e\u003e\u003e for player, scores in scores.items():\n...   results[player].append(scores)\n...\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 2, in \u003cmodule\u003e\nKeyError: 'player1'\n\u003e\u003e\u003e\n\u003e\u003e\u003e\n\u003e\u003e\u003e from collections import defaultdict\n\u003e\u003e\u003e results = defaultdict(list)\n\u003e\u003e\u003e for player, score in scores.items():\n...   results[player].append(score)\n...\n\u003e\u003e\u003e results\ndefaultdict(\u003cclass 'list'\u003e, {'player1': [100], 'player2': [75], 'player3': [99], 'player4': [99]})\n```\n\n**`counter`**\n\n```python\n# most_common.py\n# find and printing the most common IPs\nfrom pathlib import Path\n\nip_list = Path(\"ip_addresses.txt\").read_text().split()\n\nmost_common = {}\nfor ip, port in (string.split(\":\") for string in ip_list):\n    if ip not in most_common:\n        most_common[ip] = 0\n    most_common[ip] += 1\n\nfor k,v in sorted(most_common.items(),\n                  key=lambda x: x[1],\n                  reverse=True)[:5]:\n    print(k, v)\n```\n\n```sh\n➜ python most_common.py\n192.168.10.103 16\n192.168.100.1 13\n192.168.10.113 3\n192.168.100.11 2\n192.168.100.13 2\n```\n\n\n```python\n# using the most_common method from Counter\nfrom pathlib import Path\n\nip_list = Path(\"ip_addresses.txt\").read_text().split()\naddresses = [text.split(\":\")[0] for text in ip_list]\nfor ip, count in (Counter(addresses).most_common(5)):\n  print(ip, count)\n```\n\n\n\n**`dueque`**\n\nStacks and Queues that are useful for insert and delete from a sequence.\n\n```python\nimport random\nfrom collections import deque\n\nlst = list(range(100000))\ndeq = deque(range(100000))\n\ndef insert_and_delete(ds):\n  for _ in range(10):\n    index = random.choice(range(100))\n    ds.remove(index)\n    ds.insert(index, index)\n\n# in ipython\n#   ...:    ...: %timeit insert_and_delete(lst)\n#   ...:    ...: %timeit insert_and_delete(deq)\n#   ...: 701 µs ± 4.49 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n#   ...: 17.3 µs ± 208 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)\n```\n\n\n#### Day 5\n\n* Lecture: `collections` challenge\n\n* Reading: https://docs.python.org/3/library/collections.html#collections\n\n* Code: https://github.com/pybites/challenges/pull/797/files\n\n\n#### Day 6\n\n* Lecture: Datetime `timedelta` usage (TalkPython)\n\n* reading: https://docs.python.org/3/library/collections.html#collections\n\n\u003c/details\u003e\n\n\n\n\u003cdetails\u003e\u003csummary\u003eDays 7-9: Python Data Structures\u003c/summary\u003e\n\n#### Day 7\n\n* :video_camera: **Lecture**: List, Tuple and Dictionary videos (TalkPython)\n* :books: **Reading**: https://realpython.com/iterate-through-dictionary-python/\n* :notebook: **Notes**: [data structures](./datastructures)\n\n#### Day 8\n\n* :page_with_curl: **Code:**  [Bite 21 from codechalleng.es](https://codechalleng.es/bites/21/) - [My Solution](./code/day8/bite21.py)\n\n#### Day 9\n\n* :page_with_curl: **Code:**  [Bite 89 from codechalleng.es](https://codechalleng.es/bites/89/) - [My Solution](./code/day9/states.py)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 10-12: Testing with `pytest`\u003c/summary\u003e\n\n#### Day 10\n\n* :video_camera: **Lecture**: Testing your code with pytest (TalkPython)\n\n#### Day 11\n\n* :page_with_curl: **Code:** [Tests for htping](https://github.com/ttafsir/htping/tree/main/tests)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 13-15: Test-based games (classes)\u003c/summary\u003e\n\n#### Day 13\n\n* :video_camera: **Lecture**: classes with text-based games (TalkPython)\n\n#### Day 14\n\n* :page_with_curl: **Code:** [Rock Paper Scissors](https://github.com/talkpython/100daysofcode-with-python-course/tree/master/days/13-15-text-games) - [My solution](./code/day14/rps.py)\n\n#### Day 15\n\n* :page_with_curl: **Code:** [Rock Paper Scissors - 15way](https://github.com/talkpython/100daysofcode-with-python-course/tree/master/days/13-15-text-games) - [My solution](./code/day15/rps_15.py)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 16-18: List comprehensions and generators\u003c/summary\u003e\u003c/details\u003e\n\n#### Day 16\n\n* :video_camera: **Lecture**: List comprehensions and generators (TalkPython)\n\n#### Day 17\n\n* :page_with_curl: **Code:**\n\n  * [names.py](./code/day17/names.py)\n\n#### Day 18\n\n* :page_with_curl: **Code:**\n\n  * [Pybite bite 26](https://codechalleng.es/bites/26/)\n  * [Pybite challenge 11](https://codechalleng.es/challenges/11/) - [My Solution](https://github.com/pybites/challenges/pull/801)\n\n\u003cdetails\u003e\u003csummary\u003eDays 19-21: Iteration with itertools\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 22-24: Decorators\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 25-27: Error handling\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e28-30: Regular Expressions\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 31-33: Logging\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 34-36: Refactoring / Pythonic code\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 37-39: Using CSV data\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 40-42: JSON in Python\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 43-45: Consuming HTTP services\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 46-48: Web Scraping with BeautifulSoup4\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 49-51: Measuring performance\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 52-54: Parsing RSS feeds with Feedparser\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 55-57: Structured API clients with uplink\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 58-60: Twitter data analysis with Python\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 61-63: Using the Github API with Python\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 64-66: Sending emails with smtplib\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 67-69: Copy and Paste with Pyperclip\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 70-72: Excel automation with openpyxl\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 73-75: Automate tasks with Selenium\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 76-78: Getting Started with Python Flask\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 79-81: Basic Database Access with SQLite3\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 82-84: Data visualization with Plotly\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 85-87: Fullstack web apps made easy\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 88-90: Home Inventory App\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 91-93: Database access with SQLAlchemy\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 94-96: Rich GUI apps in Python\u003c/summary\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eDays 97-99: Building JSON APIs\u003c/summary\u003e\u003c/details\u003e\n\n\n\n## The progress\n\n| Day    | Status | Content |\n| ------ | ------ | ------- |\n| Day 1  |        |         |\n| Day 2  |        |         |\n| Day 3  |        |         |\n| Day 4  |        |         |\n| Day 5  |        |         |\n| Day 6  |        |         |\n| Day 7  |        |         |\n| Day 8  |        |         |\n| Day 9  |        |         |\n| Day 10 |        |         |\n| Day 11 |        |         |\n| Day 12 |        |         |\n| Day 13 |        |         |\n| Day 14 |        |         |\n| Day 15 |        |         |\n| Day 16 |        |         |\n| Day 17 |        |         |\n| Day 18 |        |         |\n| Day 19 |        |         |\n| Day 20 |        |         |\n| Day 21 |        |         |\n| Day 22 |        |         |\n| Day 23 |        |         |\n| Day 24 |        |         |\n| Day 25 |        |         |\n| Day 26 |        |         |\n| Day 27 |        |         |\n| Day 28 |        |         |\n| Day 29 |        |         |\n| Day 30 |        |         |\n| Day 31 |        |         |\n| Day 32 |        |         |\n| Day 33 |        |         |\n| Day 34 |        |         |\n| Day 35 |        |         |\n| Day 36 |        |         |\n| Day 37 |        |         |\n| Day 38 |        |         |\n| Day 39 |        |         |\n| Day 40 |        |         |\n| Day 41 |        |         |\n| Day 42 |        |         |\n| Day 43 |        |         |\n| Day 44 |        |         |\n| Day 45 |        |         |\n| Day 46 |        |         |\n| Day 47 |        |         |\n| Day 48 |        |         |\n| Day 49 |        |         |\n| Day 50 |        |         |\n| Day 51 |        |         |\n| Day 52 |        |         |\n| Day 53 |        |         |\n| Day 54 |        |         |\n| Day 55 |        |         |\n| Day 56 |        |         |\n| Day 57 |        |         |\n| Day 58 |        |         |\n| Day 59 |        |         |\n| Day 60 |        |         |\n| Day 61 |        |         |\n| Day 62 |        |         |\n| Day 63 |        |         |\n| Day 64 |        |         |\n| Day 65 |        |         |\n| Day 66 |        |         |\n| Day 67 |        |         |\n| Day 68 |        |         |\n| Day 69 |        |         |\n| Day 70 |        |         |\n| Day 71 |        |         |\n| Day 72 |        |         |\n| Day 73 |        |         |\n| Day 74 |        |         |\n| Day 75 |        |         |\n| Day 76 |        |         |\n| Day 77 |        |         |\n| Day 78 |        |         |\n| Day 79 |        |         |\n| Day 80 |        |         |\n| Day 81 |        |         |\n| Day 82 |        |         |\n| Day 83 |        |         |\n| Day 84 |        |         |\n| Day 85 |        |         |\n| Day 86 |        |         |\n| Day 87 |        |         |\n| Day 88 |        |         |\n| Day 89 |        |         |\n| Day 90 |        |         |\n| Day 91 |        |         |\n| Day 92 |        |         |\n| Day 93 |        |         |\n| Day 94 |        |         |\n| Day 95 |        |         |\n| Day 96 |        |         |\n| Day 97 |        |         |\n| Day 98 |        |         |\n| Day 99 |        |         |\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttafsir%2F100-days-of-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttafsir%2F100-days-of-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttafsir%2F100-days-of-code/lists"}