{"id":21351898,"url":"https://github.com/hygull/pyrandocs","last_synced_at":"2026-04-15T18:02:05.341Z","repository":{"id":80468840,"uuid":"168797735","full_name":"hygull/pyrandocs","owner":"hygull","description":"A repository (pyrandocs i.e. Python's v2/v3 random documents/files) containing different Python v2/v3 based resources (files/documents etc.) from random topics. A project to try different Python's features.","archived":false,"fork":false,"pushed_at":"2019-02-10T10:34:23.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T04:41:30.837Z","etag":null,"topics":["base64","beautifulsoup","class","exception-handling","hashlib","json","jwt-authentication","loops","matplotlib","nltk","numpy","pandas","python2","python27","python3","requests","searching","time-complexity","urllib","urllib2"],"latest_commit_sha":null,"homepage":null,"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/hygull.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":"2019-02-02T05:24:25.000Z","updated_at":"2019-02-10T10:34:24.000Z","dependencies_parsed_at":"2024-03-22T02:01:11.118Z","dependency_job_id":null,"html_url":"https://github.com/hygull/pyrandocs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hygull/pyrandocs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hygull%2Fpyrandocs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hygull%2Fpyrandocs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hygull%2Fpyrandocs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hygull%2Fpyrandocs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hygull","download_url":"https://codeload.github.com/hygull/pyrandocs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hygull%2Fpyrandocs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31853279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["base64","beautifulsoup","class","exception-handling","hashlib","json","jwt-authentication","loops","matplotlib","nltk","numpy","pandas","python2","python27","python3","requests","searching","time-complexity","urllib","urllib2"],"created_at":"2024-11-22T03:11:47.600Z","updated_at":"2026-04-15T18:02:05.298Z","avatar_url":"https://github.com/hygull.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyrandocs\n\n\u003ch3 id='1'\u003eString formatting\u003c/h3\u003e\n\n```bash\n\u003e\u003e\u003e d = {\n...     \"complex\": 5+6j,\n...     \"int\": 1729,\n...     \"float\": 3.14,\n...     \"string\": \"Bangalore\",\n...     \"list\": [1, 2, 3, 4, -7, 0],\n...     \"tuple\": (4,),\n...     \"dictionary\": {'fullname': 'Rishikesh Agrawani', 'active': True}\n... }\n\u003e\u003e\u003e\n\u003e\u003e\u003e for key, value in d.items():\n...     print('{0:10s} : %s'.format(key) % (value))\n... \nstring     : Bangalore\ndictionary : {'active': True, 'fullname': 'Rishikesh Agrawani'}\ntuple      : 4\nint        : 1729\nfloat      : 3.14\nlist       : [1, 2, 3, 4, -7, 0]\ncomplex    : (5+6j)\n\u003e\u003e\u003e \n```\n\n\u003ch3 id='2'\u003eStackoverflow - a solution to a problem in a simple way / no use of advanced Python concepts \u003c/h3\u003e\n\n\u003e https://stackoverflow.com/a/54500843/6615163\n\u003e\n\u003e You can try it online at https://rextester.com/ISE37337\n\n```python\n# python 3.5.2\n\ndef get_count():\n    n = int(input())\n    \n    for i in range(n):\n        s = input().strip()\n        \n        if not i:\n            l = list(set(s))\n        else:\n            i = 0\n            while l and i \u003c len(l) - 1:\n                ch = l[i]\n                if not ch in s:\n                    l.remove(ch)\n                else:\n                    i += 1\n                    \n    return len(l)\n                    \n\ncount = get_count()                    \nprint(count) # 2\n```\n\n\u003ch3 id='3'\u003eList and range() based problem's solution\u003c/h3\u003e\n\n\u003e https://stackoverflow.com/questions/54505461/how-to-print-out-elements-from-the-list-that-have-the-difference-of-2\n\n```python\n\u003e\u003e\u003e \n\u003e\u003e\u003e l = [1, 7, 12, 14, 22, 24, 29, 31, 39, 45, 77, 79, 85, 100]\n\u003e\u003e\u003e output = [(l[i], l[j]) for i in range(len(l) - 1) for j in range(i + 1, len(l)) if abs(l[i] - l[j]) == 2]\n\u003e\u003e\u003e output\n[(12, 14), (22, 24), (29, 31), (77, 79)]\n\u003e\u003e\u003e \n```\n\n```python\n\u003e\u003e\u003e \n\u003e\u003e\u003e l = [1, 7, 12, 14, 22, 24, 29, 31, 39, 45, 77, 79, 85, 100]\n\u003e\u003e\u003e \n\u003e\u003e\u003e n = len(l) - 1\n\u003e\u003e\u003e output = [(l[i], l[i + 1]) for i in range(0, n, 2) if abs(l[i] - l[i + 1]) == 2]\n\u003e\u003e\u003e output\n[(12, 14), (22, 24), (29, 31), (77, 79)]\n\u003e\u003e\u003e \n\u003e\u003e\u003e s = '\\n'.join([str(output[i][0]) + ', ' + str(output[i][1]) for i in range(len(output))])\n\u003e\u003e\u003e print(s)\n12, 14\n22, 24\n29, 31\n77, 79\n\u003e\u003e\u003e \n```\n\n\n\n\u003ch3 id='references'\u003eReferences\u003c/h3\u003e\n\n+ [How to get a list of class attributes in Python](https://www.blog.pythonlibrary.org/2013/01/11/how-to-get-a-list-of-class-attributes/)\n\n+ [List attributes of an object](https://stackoverflow.com/questions/2675028/list-attributes-of-an-object)\n\n+ [datetime, date, time](https://www.programiz.com/python-programming/datetime#example-difference-date)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhygull%2Fpyrandocs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhygull%2Fpyrandocs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhygull%2Fpyrandocs/lists"}