{"id":21635066,"url":"https://github.com/rayyanazmi/tip-calculator-python-3","last_synced_at":"2025-03-18T22:42:04.570Z","repository":{"id":209719141,"uuid":"724790473","full_name":"rayyanazmi/tip-calculator-python-3","owner":"rayyanazmi","description":"Split and Calculate your bills here!","archived":false,"fork":false,"pushed_at":"2024-08-09T13:43:59.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T00:24:10.746Z","etag":null,"topics":["calculator","python-script","splitting","tipcalculator"],"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/rayyanazmi.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":"2023-11-28T19:54:48.000Z","updated_at":"2024-08-11T14:28:19.000Z","dependencies_parsed_at":"2024-11-25T04:33:51.941Z","dependency_job_id":null,"html_url":"https://github.com/rayyanazmi/tip-calculator-python-3","commit_stats":null,"previous_names":["rayyanazmi/tip-calculator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayyanazmi%2Ftip-calculator-python-3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayyanazmi%2Ftip-calculator-python-3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayyanazmi%2Ftip-calculator-python-3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayyanazmi%2Ftip-calculator-python-3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rayyanazmi","download_url":"https://codeload.github.com/rayyanazmi/tip-calculator-python-3/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244320322,"owners_count":20434090,"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":["calculator","python-script","splitting","tipcalculator"],"created_at":"2024-11-25T03:19:24.821Z","updated_at":"2025-03-18T22:42:04.549Z","avatar_url":"https://github.com/rayyanazmi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Tip Calculator\n\nThis is a simple tip calculator program written in Python 3. It takes the total bill amount, the desired tip percentage, and the number of people splitting the bill, and then calculates the amount each person should pay.\n\n### Explanation\n\nThe program first prompts the user to enter the total bill amount. The input is converted to a float to handle decimal values. Then, the user is asked to enter the desired tip percentage, choosing from 10, 12, or 15. The input is converted to an integer. Finally, the user is asked to enter the number of people splitting the bill, which is also converted to an integer.\n\nNext, the program calculates the tip amount by multiplying the bill amount by the tip percentage as a decimal. The total bill amount is then calculated by adding the tip amount to the original bill amount. Finally, the bill amount is divided by the number of people to determine the amount each person should pay. The final amount is rounded to two decimal places before displaying it to the user.\n\n### Code Explanation\n\n```python\nprint(\"Welcome to the tip calculator.\")\n\nbill = float(input(\"What was the total bill? $\"))\ntip = int(input(\"What percentage tip would you like to give? 10, 12, or 15? \"))\npeople = int(input(\"How many people to spilt the bill? \"))\n```\n\nThis code block prompts the user to enter the bill amount, tip percentage, and number of people splitting the bill. The input is converted to the appropriate data type for further calculations.\n\n```python\ntip_as_percent = tip / 100\ntotal_tip_amount = bill * tip_as_percent\ntotal_bill = bill + total_tip_amount\n```\n\nThese lines calculate the tip amount by converting the tip percentage to a decimal and multiplying it by the bill amount. The total bill amount is then calculated by adding the tip amount to the original bill amount.\n\n```python\nbill_per_person = total_bill / people\nfinal_amount = round(bill_per_person, 2)\n```\n\nThese lines calculate the amount each person should pay by dividing the total bill amount by the number of people. The final amount is rounded to two decimal places for better presentation.\n\n```python\nprint(f\"Each person should pay: ${final_amount}\")\n```\n\nThis line prints the final amount each person should pay, using f-string formatting to include the dollar symbol.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frayyanazmi%2Ftip-calculator-python-3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frayyanazmi%2Ftip-calculator-python-3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frayyanazmi%2Ftip-calculator-python-3/lists"}