{"action":"created","comment":{"url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/pulls/comments/147903735","pull_request_review_id":73062695,"id":147903735,"diff_hunk":"@@ -0,0 +1,301 @@\n+#!/usr/bin/env python3\n+\n+\"\"\"\n+Kathryn Egan\n+\n+This program manages donors and their donations for\n+Miuvenile Care, a charity organizaiton for disadvantaged\n+kittens.\n+\"\"\"\n+\n+\n+DONORS = {\n+    'Benedict Cumberbatch': [200000.0],\n+    'Elon Musk': [10000.0, 150000.0, 100000.0],\n+    'Dad': [20.0, 5.0],\n+    'Donald Trump': [2.81],\n+    'Billy Neighbor': [.54, .01, .25]}\n+\n+COLUMN_WIDTHS = [0] * 4\n+\n+\n+def main():\n+    \"\"\" Module that drives main menu.\"\"\"\n+    options = {\n+        '1': {\n+            'prompt': 'Send a Thank You',\n+            'module': print_thank_you},\n+        '2': {\n+            'prompt': 'Create a Report',\n+            'module': print_report},\n+        '3': {\n+            'prompt': 'Write Thank Yous',\n+            'module': write_thank_yous},\n+        '4': {\n+            'prompt': 'Quit',\n+            'module': exit_program}}\n+    while True:\n+        print('Please choose from the following options:')\n+        prompt = '\\n'.join(['{} {}'.format(\n+            option, options[option]['prompt']) for option in options])\n+        answer = input(prompt + '\\n>')\n+        if answer in options:\n+            options[answer]['module']()\n+\n+\n+def exit_program():\n+    \"\"\" Exits program.\"\"\"\n+    from sys import exit\n+    print('Exiting...')\n+    exit()\n+\n+\n+def print_thank_you():\n+    \"\"\" Prompts user for donor name and amount and prints thank\n+    you note to the console. Donation amount must be numerical.\"\"\"\n+    while True:\n+        donor = input(\n+            'Who donated? (Enter LIST to see current list of donors)\\n>')\n+        if donor.upper() != 'LIST':\n+            break\n+        print()\n+        print('Current donors:')\n+        print('\\n'.join(sorted(DONORS)))\n+        print()\n+    donor = ' '.join(donor.split()).title()\n+    if donor not in DONORS:\n+        DONORS[donor] = []\n+    donation = get_donation()\n+    DONORS[donor].append(donation)\n+    thankyou = get_thank_you(donor, [donation])\n+    print(horizontal_line(80))\n+    print(thankyou)\n+    print(horizontal_line(80))\n+\n+\n+def get_donation():\n+    \"\"\" Prompts user for and returns donation amount.\n+    Returns:\n+        float : amount donated\"\"\"\n+    while True:\n+        donation = input('How much was donated?\\n>')\n+        try:\n+            donation = float(donation.strip('$'))\n+            return donation\n+        except ValueError:\n+            print('{} is not a valid amount.'.format(donation))\n+            print('Please try again.')\n+\n+\n+def horizontal_line(length):\n+    \"\"\" Returns a horizontal line of given length.\n+    Args:\n+        length (int) : length of horizontal line\n+    Returns:\n+        str : horizontal line\n+    \"\"\"\n+    return '-' * length","path":"students/kegan/session03/mailroom.py","position":97,"original_position":97,"commit_id":"d3770e3c87b35d2a692aff00143e6dd236ed50cc","original_commit_id":"d3770e3c87b35d2a692aff00143e6dd236ed50cc","user":{"login":"PythonCHB","id":1840917,"avatar_url":"https://avatars1.githubusercontent.com/u/1840917?v=4","gravatar_id":"","url":"https://api.github.com/users/PythonCHB","html_url":"https://github.com/PythonCHB","followers_url":"https://api.github.com/users/PythonCHB/followers","following_url":"https://api.github.com/users/PythonCHB/following{/other_user}","gists_url":"https://api.github.com/users/PythonCHB/gists{/gist_id}","starred_url":"https://api.github.com/users/PythonCHB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PythonCHB/subscriptions","organizations_url":"https://api.github.com/users/PythonCHB/orgs","repos_url":"https://api.github.com/users/PythonCHB/repos","events_url":"https://api.github.com/users/PythonCHB/events{/privacy}","received_events_url":"https://api.github.com/users/PythonCHB/received_events","type":"User","site_admin":false},"body":"really simple -- is it worth a function? MAybe -- if you think you may want to make it more complex at some point.","created_at":"2017-10-31T06:26:36Z","updated_at":"2017-10-31T06:48:18Z","html_url":"https://github.com/UWPCE-PythonCert/IntroPython-2017/pull/81#discussion_r147903735","pull_request_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/pulls/81","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/pulls/comments/147903735"},"html":{"href":"https://github.com/UWPCE-PythonCert/IntroPython-2017/pull/81#discussion_r147903735"},"pull_request":{"href":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/pulls/81"}}},"pull_request":{"url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/pulls/81","id":149291283,"html_url":"https://github.com/UWPCE-PythonCert/IntroPython-2017/pull/81","diff_url":"https://github.com/UWPCE-PythonCert/IntroPython-2017/pull/81.diff","patch_url":"https://github.com/UWPCE-PythonCert/IntroPython-2017/pull/81.patch","issue_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/issues/81","number":81,"state":"open","locked":false,"title":"Session03 and 04 activities","user":{"login":"kathrynegan","id":18619304,"avatar_url":"https://avatars0.githubusercontent.com/u/18619304?v=4","gravatar_id":"","url":"https://api.github.com/users/kathrynegan","html_url":"https://github.com/kathrynegan","followers_url":"https://api.github.com/users/kathrynegan/followers","following_url":"https://api.github.com/users/kathrynegan/following{/other_user}","gists_url":"https://api.github.com/users/kathrynegan/gists{/gist_id}","starred_url":"https://api.github.com/users/kathrynegan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kathrynegan/subscriptions","organizations_url":"https://api.github.com/users/kathrynegan/orgs","repos_url":"https://api.github.com/users/kathrynegan/repos","events_url":"https://api.github.com/users/kathrynegan/events{/privacy}","received_events_url":"https://api.github.com/users/kathrynegan/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-10-27T21:37:14Z","updated_at":"2017-10-31T06:48:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bd226e870e3d93dd11955f3d3fe4858106c5b51b","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/pulls/81/commits","review_comments_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/pulls/81/comments","review_comment_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/issues/81/comments","statuses_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/statuses/d3770e3c87b35d2a692aff00143e6dd236ed50cc","head":{"label":"kathrynegan:master","ref":"master","sha":"d3770e3c87b35d2a692aff00143e6dd236ed50cc","user":{"login":"kathrynegan","id":18619304,"avatar_url":"https://avatars0.githubusercontent.com/u/18619304?v=4","gravatar_id":"","url":"https://api.github.com/users/kathrynegan","html_url":"https://github.com/kathrynegan","followers_url":"https://api.github.com/users/kathrynegan/followers","following_url":"https://api.github.com/users/kathrynegan/following{/other_user}","gists_url":"https://api.github.com/users/kathrynegan/gists{/gist_id}","starred_url":"https://api.github.com/users/kathrynegan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kathrynegan/subscriptions","organizations_url":"https://api.github.com/users/kathrynegan/orgs","repos_url":"https://api.github.com/users/kathrynegan/repos","events_url":"https://api.github.com/users/kathrynegan/events{/privacy}","received_events_url":"https://api.github.com/users/kathrynegan/received_events","type":"User","site_admin":false},"repo":{"id":105726484,"name":"IntroPython-2017","full_name":"kathrynegan/IntroPython-2017","owner":{"login":"kathrynegan","id":18619304,"avatar_url":"https://avatars0.githubusercontent.com/u/18619304?v=4","gravatar_id":"","url":"https://api.github.com/users/kathrynegan","html_url":"https://github.com/kathrynegan","followers_url":"https://api.github.com/users/kathrynegan/followers","following_url":"https://api.github.com/users/kathrynegan/following{/other_user}","gists_url":"https://api.github.com/users/kathrynegan/gists{/gist_id}","starred_url":"https://api.github.com/users/kathrynegan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kathrynegan/subscriptions","organizations_url":"https://api.github.com/users/kathrynegan/orgs","repos_url":"https://api.github.com/users/kathrynegan/repos","events_url":"https://api.github.com/users/kathrynegan/events{/privacy}","received_events_url":"https://api.github.com/users/kathrynegan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kathrynegan/IntroPython-2017","description":"Class repo for the Fall 2017 Introductory class","fork":true,"url":"https://api.github.com/repos/kathrynegan/IntroPython-2017","forks_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/forks","keys_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/teams","hooks_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/hooks","issue_events_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/issues/events{/number}","events_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/events","assignees_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/assignees{/user}","branches_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/branches{/branch}","tags_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/tags","blobs_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/git/refs{/sha}","trees_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/statuses/{sha}","languages_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/languages","stargazers_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/stargazers","contributors_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/contributors","subscribers_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/subscribers","subscription_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/subscription","commits_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/commits{/sha}","git_commits_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/git/commits{/sha}","comments_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/comments{/number}","issue_comment_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/issues/comments{/number}","contents_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/contents/{+path}","compare_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/merges","archive_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/downloads","issues_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/issues{/number}","pulls_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/pulls{/number}","milestones_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/milestones{/number}","notifications_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/labels{/name}","releases_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/releases{/id}","deployments_url":"https://api.github.com/repos/kathrynegan/IntroPython-2017/deployments","created_at":"2017-10-04T02:58:11Z","updated_at":"2017-10-04T02:58:13Z","pushed_at":"2017-10-27T21:34:02Z","git_url":"git://github.com/kathrynegan/IntroPython-2017.git","ssh_url":"git@github.com:kathrynegan/IntroPython-2017.git","clone_url":"https://github.com/kathrynegan/IntroPython-2017.git","svn_url":"https://github.com/kathrynegan/IntroPython-2017","homepage":"https://uwpce-pythoncert.github.io/IntroPython-2017/","size":4097,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"UWPCE-PythonCert:master","ref":"master","sha":"c9d0116820d0e2a78af3e161f7517b92ff36eb78","user":{"login":"UWPCE-PythonCert","id":5218825,"avatar_url":"https://avatars2.githubusercontent.com/u/5218825?v=4","gravatar_id":"","url":"https://api.github.com/users/UWPCE-PythonCert","html_url":"https://github.com/UWPCE-PythonCert","followers_url":"https://api.github.com/users/UWPCE-PythonCert/followers","following_url":"https://api.github.com/users/UWPCE-PythonCert/following{/other_user}","gists_url":"https://api.github.com/users/UWPCE-PythonCert/gists{/gist_id}","starred_url":"https://api.github.com/users/UWPCE-PythonCert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UWPCE-PythonCert/subscriptions","organizations_url":"https://api.github.com/users/UWPCE-PythonCert/orgs","repos_url":"https://api.github.com/users/UWPCE-PythonCert/repos","events_url":"https://api.github.com/users/UWPCE-PythonCert/events{/privacy}","received_events_url":"https://api.github.com/users/UWPCE-PythonCert/received_events","type":"Organization","site_admin":false},"repo":{"id":102820507,"name":"IntroPython-2017","full_name":"UWPCE-PythonCert/IntroPython-2017","owner":{"login":"UWPCE-PythonCert","id":5218825,"avatar_url":"https://avatars2.githubusercontent.com/u/5218825?v=4","gravatar_id":"","url":"https://api.github.com/users/UWPCE-PythonCert","html_url":"https://github.com/UWPCE-PythonCert","followers_url":"https://api.github.com/users/UWPCE-PythonCert/followers","following_url":"https://api.github.com/users/UWPCE-PythonCert/following{/other_user}","gists_url":"https://api.github.com/users/UWPCE-PythonCert/gists{/gist_id}","starred_url":"https://api.github.com/users/UWPCE-PythonCert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UWPCE-PythonCert/subscriptions","organizations_url":"https://api.github.com/users/UWPCE-PythonCert/orgs","repos_url":"https://api.github.com/users/UWPCE-PythonCert/repos","events_url":"https://api.github.com/users/UWPCE-PythonCert/events{/privacy}","received_events_url":"https://api.github.com/users/UWPCE-PythonCert/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UWPCE-PythonCert/IntroPython-2017","description":"Class repo for the Fall 2017 Introductory class","fork":false,"url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017","forks_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/forks","keys_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/teams","hooks_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/hooks","issue_events_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/issues/events{/number}","events_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/events","assignees_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/assignees{/user}","branches_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/branches{/branch}","tags_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/tags","blobs_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/git/refs{/sha}","trees_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/statuses/{sha}","languages_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/languages","stargazers_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/stargazers","contributors_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/contributors","subscribers_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/subscribers","subscription_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/subscription","commits_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/commits{/sha}","git_commits_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/git/commits{/sha}","comments_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/comments{/number}","issue_comment_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/issues/comments{/number}","contents_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/contents/{+path}","compare_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/merges","archive_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/downloads","issues_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/issues{/number}","pulls_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/pulls{/number}","milestones_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/milestones{/number}","notifications_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/labels{/name}","releases_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/releases{/id}","deployments_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/deployments","created_at":"2017-09-08T05:17:12Z","updated_at":"2017-10-16T03:51:05Z","pushed_at":"2017-10-31T06:10:22Z","git_url":"git://github.com/UWPCE-PythonCert/IntroPython-2017.git","ssh_url":"git@github.com:UWPCE-PythonCert/IntroPython-2017.git","clone_url":"https://github.com/UWPCE-PythonCert/IntroPython-2017.git","svn_url":"https://github.com/UWPCE-PythonCert/IntroPython-2017","homepage":"https://uwpce-pythoncert.github.io/IntroPython-2017/","size":5464,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":30,"mirror_url":null,"archived":false,"open_issues_count":10,"forks":30,"open_issues":10,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/pulls/81"},"html":{"href":"https://github.com/UWPCE-PythonCert/IntroPython-2017/pull/81"},"issue":{"href":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/issues/81"},"comments":{"href":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/issues/81/comments"},"review_comments":{"href":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/pulls/81/comments"},"review_comment":{"href":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/pulls/81/commits"},"statuses":{"href":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython-2017/statuses/d3770e3c87b35d2a692aff00143e6dd236ed50cc"}},"author_association":"NONE"}}
{"actor":{"display_login":"PythonCHB"}}