{"id":22729240,"url":"https://github.com/alekkiq/python-exercises","last_synced_at":"2025-03-30T00:43:51.728Z","repository":{"id":254078863,"uuid":"844467244","full_name":"alekkiq/python-exercises","owner":"alekkiq","description":"Python exercises for my first year programming class","archived":false,"fork":false,"pushed_at":"2024-09-12T09:10:41.000Z","size":3162,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-09-12T20:02:50.049Z","etag":null,"topics":["python","python-basics","studies"],"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/alekkiq.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":"2024-08-19T10:18:27.000Z","updated_at":"2024-09-12T09:10:44.000Z","dependencies_parsed_at":"2024-08-28T14:34:48.602Z","dependency_job_id":"58c4d90b-6d9b-4e57-8a58-3db22dda9ffe","html_url":"https://github.com/alekkiq/python-exercises","commit_stats":null,"previous_names":["alekkiq/python-excersises","alekkiq/python-exercises"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekkiq%2Fpython-exercises","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekkiq%2Fpython-exercises/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekkiq%2Fpython-exercises/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekkiq%2Fpython-exercises/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alekkiq","download_url":"https://codeload.github.com/alekkiq/python-exercises/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246262491,"owners_count":20749171,"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":["python","python-basics","studies"],"created_at":"2024-12-10T18:09:13.513Z","updated_at":"2025-03-30T00:43:51.700Z","avatar_url":"https://github.com/alekkiq.png","language":"Python","readme":"# Python exercises\n\n## About\n\nThese Python exercises act as a part of my first year studies in my engineering degree.\n\nDespite the task instructions being in Finnish, the coded solutions are strictly in English, due to the English nature of the profession that is software development.\n\nThis README was made purely to serve as practice in documenting a project / codebase. Anyone with pretty much any experience with codebases or coding in general will get the idea just by looking at the directory structure as well as the singular files / scripts themselves (hopefully).\n\n### Requirements\n\nTo set up the \"project\" locally, you will need\n\n1. **Python** 3.12.x \u003c\n2. **MariaDB** 11.5.x \u003c\n3. ```airports.csv``` with correct data as in this example:\n\n```json\n\"id\",\"ident\",\"type\",\"name\",\"latitude_deg\",\"longitude_deg\",\"elevation_ft\",\"continent\",\"iso_country\",\"iso_region\",\"municipality\",\"scheduled_service\",\"gps_code\",\"iata_code\",\"local_code\",\"home_link\",\"wikipedia_link\",\"keywords\"\n6523,\"00A\",\"heliport\",\"Total Rf Heliport\",40.07080078125,-74.93360137939453,11,\"NA\",\"US\",\"US-PA\",\"Bensalem\",\"no\",\"00A\",,\"00A\",,,\n323361,\"00AA\",\"small_airport\",\"Aero B Ranch Airport\",38.704022,-101.473911,3435,\"NA\",\"US\",\"US-KS\",\"Leoti\",\"no\",\"00AA\",,\"00AA\",,,\n6524,\"00AK\",\"small_airport\",\"Lowell Field\",59.947733,-151.692524,450,\"NA\",\"US\",\"US-AK\",\"Anchor Point\",\"no\",\"00AK\",,\"00AK\",,,\n\n...\n```\n\nThe following python packages:\n1. `mysql-connector-python` - MariaDB connector\n2. `pandas` - CSV reader\n3. `geopy` - location distance calculation\n4. `tabulate` - table format printing\n5. `requests` - API requests\n6. `python-dotenv` - environment value handling (Module 12 OpenWeather API key)\n7. `Flask` - building an API\n\n\u003cdiv style=\"color: #0c5460;\n  background-color: #d1ecf1;\n  border-color: #bee5eb; padding: 16px 24px; border-radius: 5px; margin-block: 20px; line-height: 1.75\"\u003e\n\u003cb\u003eImportant:\u003c/b\u003e Make sure to add the proper values in \u003ccode style=\"color: black; padding: 4px 6px\"\u003eModules/db_helpers/db_config.py\u003c/code\u003e to match your systems MariaDB configs. You also have to add the \u003ccode style=\"color: black; padding: 4px 6px\"\u003eairports.csv\u003c/code\u003e to \u003ccode style=\"color: black; padding: 4px 6px\"\u003eModules/db_helpers/data/\u003c/code\u003e if you do not already have the right database set up in your computer. Alternatively, you can insert the data manually to the right database.\n\u003c/div\u003e\n\n### Viewing / running the exercises\n\nThe exercises will all be found under the ```Modules``` folder.\n\nMost common way you will find a singular exercise is by navigating to a ```mod0X.py``` file, and checking out the functions. Each function represents a single exercise.\n\nEach python file is named after the **module** which exercises it consists of. For example, ```mod03.py``` contains all exercises under module 1.\n\nThe exercises themselves are (***MAINLY***) separated into functions. The functions are mostly named to describe the scripts outcome rather than displaying the exercise number. You can tell which exercise does each function represent by looking for a number comment above each function's definition. \n\nBelow is an example:\n\n```python\n# \u003emod02.py \u003c--  The module number\n\n# 4 \u003c-- The exercise number\ndef print_something():\n    something = input(\"Input something: \")\n    print(something)\n\n#   print_something() \u003c-- Call the function by uncommenting!\n```\n\nThere are some exceptions to this though, the most obvious one being the whole of **Module 6**. Since Module 6 is the part that is supposed to introduce functions, I made the decision to split each exercise into it's own file.\n\nIn these cases the files are pretty self-explanitary as there is just the \"logic\" function and a main function that is being ran.\n\nLike so:\n```python\n# \u003e/mod6/2.py \u003c-- module \u0026 exercise number\n\nimport random\n\n# 2\ndef roll_custom_dice(dice_sides : int):\n    while (True):\n        rolled_value = random.randint(1, dice_sides)\n        \n        print(f\"Rolled {rolled_value}\")\n        \n        if rolled_value == dice_sides:\n            break\n\ndef main():\n    dice_sides = int(input(\"How many sides does the dice have: \"))\n\n    roll_custom_dice(dice_sides)\n\nmain() # \u003c-- The exercise runs when main() is called.\n```\n\n___________________\n### What I've learned?\n\n1. **Python** - duh. But being serious, prior to this course I had next to no experience with python, but a better understanding in other languages such as Php, Javascript and even Java. Like always, switching to a new language and syntax can be overwhelming, but I believe I actually overcame that surprisingly quick.\n2. **Problem solving**. It is common knowledge that coding is pretty much all about solving problems, and I think this course capsulated it well. The theory parts were exhausting, but rather had a lot of useful info in a very compact package. This made reading through the theory a lot less exhaustive.\n3. **Thinking**. At first glance this might sound odd, but it makes perfect sense. During these excersises I occasionally found myself overcomplicating even the most simplest of problems. But as I progressed in the tasks, I gradually learned to stop and think about alternative solutions and their pros\u0026cons before writing any lines of code.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falekkiq%2Fpython-exercises","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falekkiq%2Fpython-exercises","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falekkiq%2Fpython-exercises/lists"}