{"action":"opened","issue":{"url":"https://api.github.com/repos/Prince-linux/prince-python-learning/issues/8","labels_url":"https://api.github.com/repos/Prince-linux/prince-python-learning/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/Prince-linux/prince-python-learning/issues/8/comments","events_url":"https://api.github.com/repos/Prince-linux/prince-python-learning/issues/8/events","html_url":"https://github.com/Prince-linux/prince-python-learning/issues/8","id":102997693,"number":8,"title":"creating functions","user":{"login":"lcabrini","id":98929,"avatar_url":"https://avatars.githubusercontent.com/u/98929?v=3","gravatar_id":"","url":"https://api.github.com/users/lcabrini","html_url":"https://github.com/lcabrini","followers_url":"https://api.github.com/users/lcabrini/followers","following_url":"https://api.github.com/users/lcabrini/following{/other_user}","gists_url":"https://api.github.com/users/lcabrini/gists{/gist_id}","starred_url":"https://api.github.com/users/lcabrini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcabrini/subscriptions","organizations_url":"https://api.github.com/users/lcabrini/orgs","repos_url":"https://api.github.com/users/lcabrini/repos","events_url":"https://api.github.com/users/lcabrini/events{/privacy}","received_events_url":"https://api.github.com/users/lcabrini/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-25T10:44:14Z","updated_at":"2015-08-25T10:44:14Z","closed_at":null,"body":"A very useful feature in python is a function. Functions have several benefits.\r\n\r\n    1. They reduce complexity by breaking the program into bits\r\n    2. They can make the code easier to read by using good function names\r\n\r\nHere is a sample program. Type it in and try it.\r\n\r\n    #! /usr/bin/env python3\r\n\r\n    def hello():\r\n        print(\"Hello world!\")\r\n\r\n    print(\"I am going to call the hello function 10 times\")\r\n    hello()\r\n    hello()\r\n    hello()\r\n    hello()\r\n    hello()\r\n    hello()\r\n    hello()\r\n    hello()\r\n    hello()\r\n    hello()\r\n\r\nRun the program and study its output. Then create a version of this that calls the hello() function inside a for loop instead. Call the program func.py and place it in src/func."}}