{"id":27299952,"url":"https://github.com/parisaalizadeh2003/custom_for_loop","last_synced_at":"2025-04-12T00:50:10.460Z","repository":{"id":281182066,"uuid":"944470953","full_name":"ParisaAlizadeh2003/Custom_For_Loop","owner":"ParisaAlizadeh2003","description":"This project defines a Python class CustomFor that manually iterates over any iterable using next(), applying a specified function to each element. In this example, it capitalizes and prints each character. It demonstrates the use of iterators in Python.","archived":false,"fork":false,"pushed_at":"2025-03-07T14:23:04.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T00:50:04.266Z","etag":null,"topics":["iterable","iterate","iterator","loop","loops-and-iterations","oop","python"],"latest_commit_sha":null,"homepage":"","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/ParisaAlizadeh2003.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}},"created_at":"2025-03-07T12:01:06.000Z","updated_at":"2025-03-17T07:41:36.000Z","dependencies_parsed_at":"2025-03-07T13:30:07.458Z","dependency_job_id":null,"html_url":"https://github.com/ParisaAlizadeh2003/Custom_For_Loop","commit_stats":null,"previous_names":["parisaalizadeh2003/custom_for_loop"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParisaAlizadeh2003%2FCustom_For_Loop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParisaAlizadeh2003%2FCustom_For_Loop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParisaAlizadeh2003%2FCustom_For_Loop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParisaAlizadeh2003%2FCustom_For_Loop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ParisaAlizadeh2003","download_url":"https://codeload.github.com/ParisaAlizadeh2003/Custom_For_Loop/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248501902,"owners_count":21114681,"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","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":["iterable","iterate","iterator","loop","loops-and-iterations","oop","python"],"created_at":"2025-04-12T00:50:10.042Z","updated_at":"2025-04-12T00:50:10.454Z","avatar_url":"https://github.com/ParisaAlizadeh2003.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **CustomFor - A Simple Custom Iterator**  \n\n## **Overview**  \n`CustomFor` is a lightweight Python utility that demonstrates **manual iteration** using an explicit iterator. Instead of using a traditional `for` loop, it manually retrieves elements using `next()` and applies a function to each item.  \n\n🔹 Learn more about **Python Iterators** here: [Python Iterators](https://docs.python.org/3/tutorial/classes.html#iterators)  \n\n## **Features**  \n✅ Custom iteration over any iterable  \n✅ Applies a given function to each item  \n✅ Includes a built-in `capitalize` function  \n\n## **Installation**  \nNo external dependencies are required. Just clone the repository and run the script.  \n\n```bash\ngit clone https://github.com/YOUR-USERNAME/custom-for-loop.git\ncd custom-for-loop\npython custom_for.py\n```\n\n## **Usage**  \nHere’s how the `CustomFor` class works:  \n\n```python\nclass CustomFor:\n    @staticmethod\n    def iterate(iterable, func):\n        iterator = iter(iterable)\n        while True:\n            try:\n                item = next(iterator)\n            except StopIteration:\n                return\n            else:\n                func(item)\n\n    @staticmethod\n    def capitalize(item):\n        print(str.capitalize(item))\n\ndef main():\n    CustomFor.iterate(input(\"Enter your iterable: \"), CustomFor.capitalize)\n\nif __name__ == \"__main__\":\n    main()\n```\n\n### **Example**  \n#### **Input:**  \n```\nEnter your iterable: hello\n```\n#### **Output:**  \n```\nH\nE\nL\nL\nO\n```\n\n## **Contributing**  \nWant to improve this project? Feel free to fork the repository and submit a pull request! 🚀  \n\n## **License**  \nThis project is licensed under the **MIT License**.  \n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparisaalizadeh2003%2Fcustom_for_loop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparisaalizadeh2003%2Fcustom_for_loop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparisaalizadeh2003%2Fcustom_for_loop/lists"}