{"action":"opened","issue":{"url":"https://api.github.com/repos/saintnate/pwp-capstones/issues/5","repository_url":"https://api.github.com/repos/saintnate/pwp-capstones","labels_url":"https://api.github.com/repos/saintnate/pwp-capstones/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/saintnate/pwp-capstones/issues/5/comments","events_url":"https://api.github.com/repos/saintnate/pwp-capstones/issues/5/events","html_url":"https://github.com/saintnate/pwp-capstones/issues/5","id":353490818,"node_id":"MDU6SXNzdWUzNTM0OTA4MTg=","number":5,"title":"ngram creator","user":{"login":"hmontero1205","id":22177160,"node_id":"MDQ6VXNlcjIyMTc3MTYw","avatar_url":"https://avatars1.githubusercontent.com/u/22177160?v=4","gravatar_id":"","url":"https://api.github.com/users/hmontero1205","html_url":"https://github.com/hmontero1205","followers_url":"https://api.github.com/users/hmontero1205/followers","following_url":"https://api.github.com/users/hmontero1205/following{/other_user}","gists_url":"https://api.github.com/users/hmontero1205/gists{/gist_id}","starred_url":"https://api.github.com/users/hmontero1205/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmontero1205/subscriptions","organizations_url":"https://api.github.com/users/hmontero1205/orgs","repos_url":"https://api.github.com/users/hmontero1205/repos","events_url":"https://api.github.com/users/hmontero1205/events{/privacy}","received_events_url":"https://api.github.com/users/hmontero1205/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-23T17:59:58Z","updated_at":"2018-08-23T17:59:58Z","closed_at":null,"author_association":"NONE","body":"Your code here is inefficient because it checks if `i` is not the last element every single time.\r\nInstead of doing this:\r\n```\r\ndef ngram_creator(text_list):\r\n    ngram = []\r\n    for i in range(len(text_list)):\r\n        if i != len(text_list) - 1:\r\n            ngram.append(text_list[i] + \" \" + text_list[i+1])\r\n    return ngram\r\n```\r\nJust do this:\r\n```\r\ndef ngram_creator(text_list):\r\n    ngram = []\r\n    for i in range(len(text_list) - 1):\r\n            ngram.append(text_list[i] + \" \" + text_list[i+1])\r\n    return ngram\r\n```"}}
{"actor":{"display_login":"hmontero1205"}}