{"action":"created","comment":{"url":"https://api.github.com/repos/python-boot-camp/HW06/pulls/comments/36853411","id":36853411,"diff_hunk":"@@ -18,10 +18,77 @@\n \n # Body\n \n+def uses_only(word, letterCombination):\n+\tlistOfLetters = letterCombination.split(\",\")\n \n+\tfor char in word:\n+\t\tif char not in listOfLetters:\n+\t\t\treturn False\n+\n+\treturn True\n+\n+def get_words(filename,letterCombination):\n+\twith open(filename, 'r') as f:\n+\t\tlistOfWords = []\n+\n+\t\tfor lines in f:\n+\t\t\tfor words in lines.split():\n+\t\t\t\tif(uses_only(words.strip(),letterCombination)):\n+\t\t\t\t\tlistOfWords.append(words)\n+\n+\treturn listOfWords\n+\n+def form_sentence(listOfWords):\n+\tsentence = []\n+\n+\twhile True:\n+\t\tprint\n+\t\tprint\n+\t\tprint\n+\t\tprint (\"Valid words : \")\n+\t\tprint (repr(listOfWords))\n+\t\t\n+\t\tif sentence:\n+\t\t\tprint (\"Current sentence is : \"+repr(fetch_statement(sentence)))\n+\t\t\tprint\n+\t\t\tprint\n+\t\t\tprint\n+\n+\t\tuserInput = raw_input(\"Pick a word to append to your sentence: \")\n+\t\t\n+\t\tif userInput in listOfWords:\n+\t\t\tsentence.append(userInput)\n+\n+\t\telif userInput == \"end_this\":\n+\t\t\treturn sentence\n+\n+\t\telse :\n+\t\t\tprint (\"Incorrect word entered. Try again or type 'end_this' to complete your sentence\")\n+\n+def fetch_statement(sentence):\n+\tstatement = ''\n+\tfor words in sentence:\n+\t\tstatement += words + \" \"\n+\n+\treturn statement.strip()\n ##############################################################################\n def main():\n-    pass  # Call your function(s) here.\n+\tprint (\"1st Problem\")\n+\tprint (repr(uses_only(\"abcbcabcbcba\",\"a,b,c\")))\n+\tprint\n+\tprint (\"2nd Problem - Getting all valid words\")\n+\tprint (\"All the valid words are :\")\n+\tlistOfWords = get_words(\"words.txt\",\"a,c,e,f,h,l,o\")\n+\tprint (repr(listOfWords))\n+\tprint\n+\tprint\n+\tprint (\"Forming sentence\")\n+\tprint\n+\tprint\n+\tprint (\"The sentence formed is : \"+repr(fetch_statement(form_sentence(listOfWords))))","path":"HW06_ex09_04.py","position":81,"original_position":81,"commit_id":"247f73ce2810c37b377935770b269463443ef7a2","original_commit_id":"247f73ce2810c37b377935770b269463443ef7a2","user":{"login":"danielsgriffin","id":6070690,"avatar_url":"https://avatars.githubusercontent.com/u/6070690?v=3","gravatar_id":"","url":"https://api.github.com/users/danielsgriffin","html_url":"https://github.com/danielsgriffin","followers_url":"https://api.github.com/users/danielsgriffin/followers","following_url":"https://api.github.com/users/danielsgriffin/following{/other_user}","gists_url":"https://api.github.com/users/danielsgriffin/gists{/gist_id}","starred_url":"https://api.github.com/users/danielsgriffin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielsgriffin/subscriptions","organizations_url":"https://api.github.com/users/danielsgriffin/orgs","repos_url":"https://api.github.com/users/danielsgriffin/repos","events_url":"https://api.github.com/users/danielsgriffin/events{/privacy}","received_events_url":"https://api.github.com/users/danielsgriffin/received_events","type":"User","site_admin":false},"body":"Very neat: \"hella cool\"","created_at":"2015-08-12T12:28:32Z","updated_at":"2015-08-12T12:28:32Z","html_url":"https://github.com/python-boot-camp/HW06/pull/14#discussion_r36853411","pull_request_url":"https://api.github.com/repos/python-boot-camp/HW06/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/python-boot-camp/HW06/pulls/comments/36853411"},"html":{"href":"https://github.com/python-boot-camp/HW06/pull/14#discussion_r36853411"},"pull_request":{"href":"https://api.github.com/repos/python-boot-camp/HW06/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/python-boot-camp/HW06/pulls/14","id":42208067,"html_url":"https://github.com/python-boot-camp/HW06/pull/14","diff_url":"https://github.com/python-boot-camp/HW06/pull/14.diff","patch_url":"https://github.com/python-boot-camp/HW06/pull/14.patch","issue_url":"https://api.github.com/repos/python-boot-camp/HW06/issues/14","number":14,"state":"open","locked":false,"title":"Commiting changes for 6th day assignment","user":{"login":"akumar90","id":13646657,"avatar_url":"https://avatars.githubusercontent.com/u/13646657?v=3","gravatar_id":"","url":"https://api.github.com/users/akumar90","html_url":"https://github.com/akumar90","followers_url":"https://api.github.com/users/akumar90/followers","following_url":"https://api.github.com/users/akumar90/following{/other_user}","gists_url":"https://api.github.com/users/akumar90/gists{/gist_id}","starred_url":"https://api.github.com/users/akumar90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akumar90/subscriptions","organizations_url":"https://api.github.com/users/akumar90/orgs","repos_url":"https://api.github.com/users/akumar90/repos","events_url":"https://api.github.com/users/akumar90/events{/privacy}","received_events_url":"https://api.github.com/users/akumar90/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-12T06:28:01Z","updated_at":"2015-08-12T12:28:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e47babbc979340032ecc46f0c4a3d5a5816ab0ff","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/python-boot-camp/HW06/pulls/14/commits","review_comments_url":"https://api.github.com/repos/python-boot-camp/HW06/pulls/14/comments","review_comment_url":"https://api.github.com/repos/python-boot-camp/HW06/pulls/comments{/number}","comments_url":"https://api.github.com/repos/python-boot-camp/HW06/issues/14/comments","statuses_url":"https://api.github.com/repos/python-boot-camp/HW06/statuses/247f73ce2810c37b377935770b269463443ef7a2","head":{"label":"akumar90:master","ref":"master","sha":"247f73ce2810c37b377935770b269463443ef7a2","user":{"login":"akumar90","id":13646657,"avatar_url":"https://avatars.githubusercontent.com/u/13646657?v=3","gravatar_id":"","url":"https://api.github.com/users/akumar90","html_url":"https://github.com/akumar90","followers_url":"https://api.github.com/users/akumar90/followers","following_url":"https://api.github.com/users/akumar90/following{/other_user}","gists_url":"https://api.github.com/users/akumar90/gists{/gist_id}","starred_url":"https://api.github.com/users/akumar90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akumar90/subscriptions","organizations_url":"https://api.github.com/users/akumar90/orgs","repos_url":"https://api.github.com/users/akumar90/repos","events_url":"https://api.github.com/users/akumar90/events{/privacy}","received_events_url":"https://api.github.com/users/akumar90/received_events","type":"User","site_admin":false},"repo":{"id":40552051,"name":"HW06","full_name":"akumar90/HW06","owner":{"login":"akumar90","id":13646657,"avatar_url":"https://avatars.githubusercontent.com/u/13646657?v=3","gravatar_id":"","url":"https://api.github.com/users/akumar90","html_url":"https://github.com/akumar90","followers_url":"https://api.github.com/users/akumar90/followers","following_url":"https://api.github.com/users/akumar90/following{/other_user}","gists_url":"https://api.github.com/users/akumar90/gists{/gist_id}","starred_url":"https://api.github.com/users/akumar90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akumar90/subscriptions","organizations_url":"https://api.github.com/users/akumar90/orgs","repos_url":"https://api.github.com/users/akumar90/repos","events_url":"https://api.github.com/users/akumar90/events{/privacy}","received_events_url":"https://api.github.com/users/akumar90/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/akumar90/HW06","description":"","fork":true,"url":"https://api.github.com/repos/akumar90/HW06","forks_url":"https://api.github.com/repos/akumar90/HW06/forks","keys_url":"https://api.github.com/repos/akumar90/HW06/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akumar90/HW06/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akumar90/HW06/teams","hooks_url":"https://api.github.com/repos/akumar90/HW06/hooks","issue_events_url":"https://api.github.com/repos/akumar90/HW06/issues/events{/number}","events_url":"https://api.github.com/repos/akumar90/HW06/events","assignees_url":"https://api.github.com/repos/akumar90/HW06/assignees{/user}","branches_url":"https://api.github.com/repos/akumar90/HW06/branches{/branch}","tags_url":"https://api.github.com/repos/akumar90/HW06/tags","blobs_url":"https://api.github.com/repos/akumar90/HW06/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akumar90/HW06/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akumar90/HW06/git/refs{/sha}","trees_url":"https://api.github.com/repos/akumar90/HW06/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akumar90/HW06/statuses/{sha}","languages_url":"https://api.github.com/repos/akumar90/HW06/languages","stargazers_url":"https://api.github.com/repos/akumar90/HW06/stargazers","contributors_url":"https://api.github.com/repos/akumar90/HW06/contributors","subscribers_url":"https://api.github.com/repos/akumar90/HW06/subscribers","subscription_url":"https://api.github.com/repos/akumar90/HW06/subscription","commits_url":"https://api.github.com/repos/akumar90/HW06/commits{/sha}","git_commits_url":"https://api.github.com/repos/akumar90/HW06/git/commits{/sha}","comments_url":"https://api.github.com/repos/akumar90/HW06/comments{/number}","issue_comment_url":"https://api.github.com/repos/akumar90/HW06/issues/comments{/number}","contents_url":"https://api.github.com/repos/akumar90/HW06/contents/{+path}","compare_url":"https://api.github.com/repos/akumar90/HW06/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akumar90/HW06/merges","archive_url":"https://api.github.com/repos/akumar90/HW06/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akumar90/HW06/downloads","issues_url":"https://api.github.com/repos/akumar90/HW06/issues{/number}","pulls_url":"https://api.github.com/repos/akumar90/HW06/pulls{/number}","milestones_url":"https://api.github.com/repos/akumar90/HW06/milestones{/number}","notifications_url":"https://api.github.com/repos/akumar90/HW06/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akumar90/HW06/labels{/name}","releases_url":"https://api.github.com/repos/akumar90/HW06/releases{/id}","created_at":"2015-08-11T16:13:26Z","updated_at":"2015-08-11T16:13:26Z","pushed_at":"2015-08-12T06:27:22Z","git_url":"git://github.com/akumar90/HW06.git","ssh_url":"git@github.com:akumar90/HW06.git","clone_url":"https://github.com/akumar90/HW06.git","svn_url":"https://github.com/akumar90/HW06","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"python-boot-camp:master","ref":"master","sha":"5f83858e3b1ce7dec99e5812752acbe0d67f94b9","user":{"login":"python-boot-camp","id":13564087,"avatar_url":"https://avatars.githubusercontent.com/u/13564087?v=3","gravatar_id":"","url":"https://api.github.com/users/python-boot-camp","html_url":"https://github.com/python-boot-camp","followers_url":"https://api.github.com/users/python-boot-camp/followers","following_url":"https://api.github.com/users/python-boot-camp/following{/other_user}","gists_url":"https://api.github.com/users/python-boot-camp/gists{/gist_id}","starred_url":"https://api.github.com/users/python-boot-camp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python-boot-camp/subscriptions","organizations_url":"https://api.github.com/users/python-boot-camp/orgs","repos_url":"https://api.github.com/users/python-boot-camp/repos","events_url":"https://api.github.com/users/python-boot-camp/events{/privacy}","received_events_url":"https://api.github.com/users/python-boot-camp/received_events","type":"Organization","site_admin":false},"repo":{"id":40543562,"name":"HW06","full_name":"python-boot-camp/HW06","owner":{"login":"python-boot-camp","id":13564087,"avatar_url":"https://avatars.githubusercontent.com/u/13564087?v=3","gravatar_id":"","url":"https://api.github.com/users/python-boot-camp","html_url":"https://github.com/python-boot-camp","followers_url":"https://api.github.com/users/python-boot-camp/followers","following_url":"https://api.github.com/users/python-boot-camp/following{/other_user}","gists_url":"https://api.github.com/users/python-boot-camp/gists{/gist_id}","starred_url":"https://api.github.com/users/python-boot-camp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python-boot-camp/subscriptions","organizations_url":"https://api.github.com/users/python-boot-camp/orgs","repos_url":"https://api.github.com/users/python-boot-camp/repos","events_url":"https://api.github.com/users/python-boot-camp/events{/privacy}","received_events_url":"https://api.github.com/users/python-boot-camp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/python-boot-camp/HW06","description":"","fork":false,"url":"https://api.github.com/repos/python-boot-camp/HW06","forks_url":"https://api.github.com/repos/python-boot-camp/HW06/forks","keys_url":"https://api.github.com/repos/python-boot-camp/HW06/keys{/key_id}","collaborators_url":"https://api.github.com/repos/python-boot-camp/HW06/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/python-boot-camp/HW06/teams","hooks_url":"https://api.github.com/repos/python-boot-camp/HW06/hooks","issue_events_url":"https://api.github.com/repos/python-boot-camp/HW06/issues/events{/number}","events_url":"https://api.github.com/repos/python-boot-camp/HW06/events","assignees_url":"https://api.github.com/repos/python-boot-camp/HW06/assignees{/user}","branches_url":"https://api.github.com/repos/python-boot-camp/HW06/branches{/branch}","tags_url":"https://api.github.com/repos/python-boot-camp/HW06/tags","blobs_url":"https://api.github.com/repos/python-boot-camp/HW06/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/python-boot-camp/HW06/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/python-boot-camp/HW06/git/refs{/sha}","trees_url":"https://api.github.com/repos/python-boot-camp/HW06/git/trees{/sha}","statuses_url":"https://api.github.com/repos/python-boot-camp/HW06/statuses/{sha}","languages_url":"https://api.github.com/repos/python-boot-camp/HW06/languages","stargazers_url":"https://api.github.com/repos/python-boot-camp/HW06/stargazers","contributors_url":"https://api.github.com/repos/python-boot-camp/HW06/contributors","subscribers_url":"https://api.github.com/repos/python-boot-camp/HW06/subscribers","subscription_url":"https://api.github.com/repos/python-boot-camp/HW06/subscription","commits_url":"https://api.github.com/repos/python-boot-camp/HW06/commits{/sha}","git_commits_url":"https://api.github.com/repos/python-boot-camp/HW06/git/commits{/sha}","comments_url":"https://api.github.com/repos/python-boot-camp/HW06/comments{/number}","issue_comment_url":"https://api.github.com/repos/python-boot-camp/HW06/issues/comments{/number}","contents_url":"https://api.github.com/repos/python-boot-camp/HW06/contents/{+path}","compare_url":"https://api.github.com/repos/python-boot-camp/HW06/compare/{base}...{head}","merges_url":"https://api.github.com/repos/python-boot-camp/HW06/merges","archive_url":"https://api.github.com/repos/python-boot-camp/HW06/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/python-boot-camp/HW06/downloads","issues_url":"https://api.github.com/repos/python-boot-camp/HW06/issues{/number}","pulls_url":"https://api.github.com/repos/python-boot-camp/HW06/pulls{/number}","milestones_url":"https://api.github.com/repos/python-boot-camp/HW06/milestones{/number}","notifications_url":"https://api.github.com/repos/python-boot-camp/HW06/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/python-boot-camp/HW06/labels{/name}","releases_url":"https://api.github.com/repos/python-boot-camp/HW06/releases{/id}","created_at":"2015-08-11T13:34:44Z","updated_at":"2015-08-11T13:41:00Z","pushed_at":"2015-08-12T07:54:16Z","git_url":"git://github.com/python-boot-camp/HW06.git","ssh_url":"git@github.com:python-boot-camp/HW06.git","clone_url":"https://github.com/python-boot-camp/HW06.git","svn_url":"https://github.com/python-boot-camp/HW06","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":20,"forks":21,"open_issues":20,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/python-boot-camp/HW06/pulls/14"},"html":{"href":"https://github.com/python-boot-camp/HW06/pull/14"},"issue":{"href":"https://api.github.com/repos/python-boot-camp/HW06/issues/14"},"comments":{"href":"https://api.github.com/repos/python-boot-camp/HW06/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/python-boot-camp/HW06/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/python-boot-camp/HW06/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/python-boot-camp/HW06/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/python-boot-camp/HW06/statuses/247f73ce2810c37b377935770b269463443ef7a2"}}}}