{"action":"created","comment":{"url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/pulls/comments/175137678","pull_request_review_id":104606802,"id":175137678,"diff_hunk":"@@ -0,0 +1,158 @@\n+#The length of segment\n+\n+import math\n+\n+def distance(x1,y1,x2,y2):\n+    distance = math.sqrt(((x2-x1)**2)+((y2-y1)**2))\n+    print(distance)\n+\n+first_x = float(input(\"Type first X: \"))\n+first_y = float(input(\"Type first Y: \"))\n+second_x = float(input(\"Type second X: \"))\n+second_y = float(input(\"Type second Y: \"))\n+\n+print(distance(first_x,first_y,second_x,second_y))\n+\n+#Negative exponent\n+def power(a,n):\n+    if n == 0:\n+        print(1)\n+    else:\n+        print(a**n)\n+\n+while True:\n+    real_number = int(input(\"Type real, positive number\"))\n+    if realNumber <= 0:\n+        print(\"I said POSITIVE\")\n+        continue\n+    else:\n+        real_power = int(input(\"Now type power: \"))\n+        print(power(real_number, real_power))\n+        break\n+\n+#Exponentiation\n+def exponentiation(value, to_the_power):\n+    if to_the_power == 0:\n+        return 1\n+    else:\n+        return value * exponentiation(value, to_the_power-1)\n+\n+print(exponentiation(float(input(\"Type number: \")), int(input(\"To the power of: \"))))\n+\n+#Fibonacci numbers\n+def fib(x):\n+    if x == 0:\n+        return 0\n+    elif x == 1:\n+        return 1\n+    else:\n+        return fib(x-1)+ fib(x-2)\n+\n+which_number_user_wants_to_calculate = float(input(\"Which Fibonnaci number you want to see? \"))\n+\n+print(fib(which_number_user_wants_to_calculate))\n+\n+#The Collatz Sequence\n+def collatz(number):\n+        if number % 2 == 0:\n+            return number//2\n+        elif number % 2 ==1:\n+            return 3 * number + 1\n+        else:\n+            print(\"What sort of input is this???\")\n+\n+number_to_check = float(input(\"Enter a number for a collatz sequence: \"))\n+is_this_number_one = collatz(number_to_check)\n+\n+print(number_to_check)\n+print(is_this_number_one)\n+while is_this_number_one != 1:\n+    print(collatz(is_this_number_one))\n+    is_this_number_one = collatz(is_this_number_one)\n+\n+#Input Validation\n+def collatz(number):\n+    if number % 2 == 0:\n+        return number // 2\n+    elif number % 2 == 1:\n+        return 3 * number + 1\n+    else:\n+        print(\"What sort of input is this???\")\n+\n+while True:\n+    try:\n+        number_to_check = float(input(\"Enter a number for a collatz sequence: \"))\n+        break\n+    except ValueError:\n+        print(\"This is not a number\")\n+\n+isThisNumberOne = collatz(number_to_check)\n+\n+print(number_to_check)\n+print(is_this_number_one)\n+while is_this_number_one != 1:\n+    print(collatz(is_this_number_one))\n+    is_this_number_one = collatz(is_this_number_one)\n+\n+#Calculator\n+print(input(\"Welcome to badly organized calculator: \"\n+            \"\\na - add\"\n+            \"\\ns - subtract\"\n+            \"\\nm - multiply\"\n+            \"\\nd - divide\"\n+            \"\\np - power\"\n+            \"\\nh,? - help\"\n+            \"\\nq - QUIT\"))\n+\n+def adding(addX, addY):\n+    print(\"ADDING\\nResult: \" + str(addX + addY))\n+\n+def subtract(subX, subY):\n+    print(\"SUBTRACT\\nResult: \" + str(subX - subY))\n+\n+def multiply(mulX, mulY):\n+    print(\"MULTIPLY\\nResult: \" + str(mulX * mulY))\n+\n+def divide(divX, divY):\n+    print(\"DIVIDE\\nResult: \" + str(divX / diivY))\n+\n+def power(powX, powY):\n+    print(\"POWER\\nResult: \" + str(powX ** powY))\n+\n+def help():\n+    input(\"HELP \"\n+          \"\\na - add\"\n+          \"\\ns - subtract\"\n+          \"\\nm - multiply\"\n+          \"\\nd - divide\"\n+          \"\\np - power\"\n+          \"\\nh,? - help\"\n+          \"\\nq - QUIT\")\n+\n+def bye():\n+    print(\"GOOD BYE\")\n+\n+while True:\n+    option = str(input(\"Enter option:\"))\n+    firstValue = int(input(\"Input 1st operand:\"))\n+    secondValue = int(input(\"Input 2st operand:\"))\n+\n+    if option == \"a\":\n+        adding(firstValue, secondValue)\n+    elif option == \"s\":\n+        subtract(firstValue, secondValue)\n+    elif option == \"m\":\n+        multiply(firstValue, secondValue)\n+    elif option == \"d\":\n+        divide(firstValue, secondValue)\n+    elif option == \"p\":\n+        power(firstValue, secondValue)\n+    elif option == \"h\":\n+        help()\n+    elif option == \"?\":\n+        help()\n+    elif option == \"q\":\n+        bye()\n+        break\n+    else:\n+        break","path":"students/sikorski_marcin/Lesson_3_Python_basics.py","position":158,"original_position":158,"commit_id":"4a90c9adddffceb0aa15e9a332a37bbe049e13c8","original_commit_id":"4a90c9adddffceb0aa15e9a332a37bbe049e13c8","user":{"login":"kadilak83","id":32517941,"avatar_url":"https://avatars2.githubusercontent.com/u/32517941?v=4","gravatar_id":"","url":"https://api.github.com/users/kadilak83","html_url":"https://github.com/kadilak83","followers_url":"https://api.github.com/users/kadilak83/followers","following_url":"https://api.github.com/users/kadilak83/following{/other_user}","gists_url":"https://api.github.com/users/kadilak83/gists{/gist_id}","starred_url":"https://api.github.com/users/kadilak83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kadilak83/subscriptions","organizations_url":"https://api.github.com/users/kadilak83/orgs","repos_url":"https://api.github.com/users/kadilak83/repos","events_url":"https://api.github.com/users/kadilak83/events{/privacy}","received_events_url":"https://api.github.com/users/kadilak83/received_events","type":"User","site_admin":false},"body":"Jako, że chcemy zakończyć działanie tylko jeśli uzytkownik wybierze opcje quit: 'q', lepiej jest dodac komunikat o błędnie wybranje opcji i ewentualnie wyświetlić help.\r\nbrak lini na końcu pliku.\r\n","created_at":"2018-03-16T16:03:51Z","updated_at":"2018-03-16T16:03:57Z","html_url":"https://github.com/jedzej/tietopythontraining-basic/pull/235#discussion_r175137678","pull_request_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/pulls/235","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/jedzej/tietopythontraining-basic/pulls/comments/175137678"},"html":{"href":"https://github.com/jedzej/tietopythontraining-basic/pull/235#discussion_r175137678"},"pull_request":{"href":"https://api.github.com/repos/jedzej/tietopythontraining-basic/pulls/235"}}},"pull_request":{"url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/pulls/235","id":175056444,"html_url":"https://github.com/jedzej/tietopythontraining-basic/pull/235","diff_url":"https://github.com/jedzej/tietopythontraining-basic/pull/235.diff","patch_url":"https://github.com/jedzej/tietopythontraining-basic/pull/235.patch","issue_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/issues/235","number":235,"state":"open","locked":false,"title":"Kadilak83/lesson 3 answers","user":{"login":"hakuzaijo","id":15124308,"avatar_url":"https://avatars3.githubusercontent.com/u/15124308?v=4","gravatar_id":"","url":"https://api.github.com/users/hakuzaijo","html_url":"https://github.com/hakuzaijo","followers_url":"https://api.github.com/users/hakuzaijo/followers","following_url":"https://api.github.com/users/hakuzaijo/following{/other_user}","gists_url":"https://api.github.com/users/hakuzaijo/gists{/gist_id}","starred_url":"https://api.github.com/users/hakuzaijo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hakuzaijo/subscriptions","organizations_url":"https://api.github.com/users/hakuzaijo/orgs","repos_url":"https://api.github.com/users/hakuzaijo/repos","events_url":"https://api.github.com/users/hakuzaijo/events{/privacy}","received_events_url":"https://api.github.com/users/hakuzaijo/received_events","type":"User","site_admin":false},"body":"@kadilak83 Odpowiedzi do lekcji 3","created_at":"2018-03-14T19:07:29Z","updated_at":"2018-03-16T16:03:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"514fcd23e23a35c8f4728532272c215d92cadda6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":848813585,"url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/labels/kadilak83","name":"kadilak83","color":"c5def5","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/pulls/235/commits","review_comments_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/pulls/235/comments","review_comment_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/issues/235/comments","statuses_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/statuses/4a90c9adddffceb0aa15e9a332a37bbe049e13c8","head":{"label":"hakuzaijo:kadilak83/Lesson_3_answers","ref":"kadilak83/Lesson_3_answers","sha":"4a90c9adddffceb0aa15e9a332a37bbe049e13c8","user":{"login":"hakuzaijo","id":15124308,"avatar_url":"https://avatars3.githubusercontent.com/u/15124308?v=4","gravatar_id":"","url":"https://api.github.com/users/hakuzaijo","html_url":"https://github.com/hakuzaijo","followers_url":"https://api.github.com/users/hakuzaijo/followers","following_url":"https://api.github.com/users/hakuzaijo/following{/other_user}","gists_url":"https://api.github.com/users/hakuzaijo/gists{/gist_id}","starred_url":"https://api.github.com/users/hakuzaijo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hakuzaijo/subscriptions","organizations_url":"https://api.github.com/users/hakuzaijo/orgs","repos_url":"https://api.github.com/users/hakuzaijo/repos","events_url":"https://api.github.com/users/hakuzaijo/events{/privacy}","received_events_url":"https://api.github.com/users/hakuzaijo/received_events","type":"User","site_admin":false},"repo":{"id":120668122,"name":"tietopythontraining-basic","full_name":"hakuzaijo/tietopythontraining-basic","owner":{"login":"hakuzaijo","id":15124308,"avatar_url":"https://avatars3.githubusercontent.com/u/15124308?v=4","gravatar_id":"","url":"https://api.github.com/users/hakuzaijo","html_url":"https://github.com/hakuzaijo","followers_url":"https://api.github.com/users/hakuzaijo/followers","following_url":"https://api.github.com/users/hakuzaijo/following{/other_user}","gists_url":"https://api.github.com/users/hakuzaijo/gists{/gist_id}","starred_url":"https://api.github.com/users/hakuzaijo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hakuzaijo/subscriptions","organizations_url":"https://api.github.com/users/hakuzaijo/orgs","repos_url":"https://api.github.com/users/hakuzaijo/repos","events_url":"https://api.github.com/users/hakuzaijo/events{/privacy}","received_events_url":"https://api.github.com/users/hakuzaijo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hakuzaijo/tietopythontraining-basic","description":null,"fork":true,"url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic","forks_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/forks","keys_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/teams","hooks_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/hooks","issue_events_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/issues/events{/number}","events_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/events","assignees_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/assignees{/user}","branches_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/branches{/branch}","tags_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/tags","blobs_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/git/refs{/sha}","trees_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/statuses/{sha}","languages_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/languages","stargazers_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/stargazers","contributors_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/contributors","subscribers_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/subscribers","subscription_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/subscription","commits_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/commits{/sha}","git_commits_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/git/commits{/sha}","comments_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/comments{/number}","issue_comment_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/issues/comments{/number}","contents_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/contents/{+path}","compare_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/merges","archive_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/downloads","issues_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/issues{/number}","pulls_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/pulls{/number}","milestones_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/milestones{/number}","notifications_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/labels{/name}","releases_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/releases{/id}","deployments_url":"https://api.github.com/repos/hakuzaijo/tietopythontraining-basic/deployments","created_at":"2018-02-07T20:32:33Z","updated_at":"2018-02-07T20:32:35Z","pushed_at":"2018-03-14T19:07:02Z","git_url":"git://github.com/hakuzaijo/tietopythontraining-basic.git","ssh_url":"git@github.com:hakuzaijo/tietopythontraining-basic.git","clone_url":"https://github.com/hakuzaijo/tietopythontraining-basic.git","svn_url":"https://github.com/hakuzaijo/tietopythontraining-basic","homepage":null,"size":495,"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,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jedzej:master","ref":"master","sha":"cf7e119af65c0786fa4cd1f0cb11be3001597655","user":{"login":"jedzej","id":57070,"avatar_url":"https://avatars0.githubusercontent.com/u/57070?v=4","gravatar_id":"","url":"https://api.github.com/users/jedzej","html_url":"https://github.com/jedzej","followers_url":"https://api.github.com/users/jedzej/followers","following_url":"https://api.github.com/users/jedzej/following{/other_user}","gists_url":"https://api.github.com/users/jedzej/gists{/gist_id}","starred_url":"https://api.github.com/users/jedzej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedzej/subscriptions","organizations_url":"https://api.github.com/users/jedzej/orgs","repos_url":"https://api.github.com/users/jedzej/repos","events_url":"https://api.github.com/users/jedzej/events{/privacy}","received_events_url":"https://api.github.com/users/jedzej/received_events","type":"User","site_admin":false},"repo":{"id":118122178,"name":"tietopythontraining-basic","full_name":"jedzej/tietopythontraining-basic","owner":{"login":"jedzej","id":57070,"avatar_url":"https://avatars0.githubusercontent.com/u/57070?v=4","gravatar_id":"","url":"https://api.github.com/users/jedzej","html_url":"https://github.com/jedzej","followers_url":"https://api.github.com/users/jedzej/followers","following_url":"https://api.github.com/users/jedzej/following{/other_user}","gists_url":"https://api.github.com/users/jedzej/gists{/gist_id}","starred_url":"https://api.github.com/users/jedzej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedzej/subscriptions","organizations_url":"https://api.github.com/users/jedzej/orgs","repos_url":"https://api.github.com/users/jedzej/repos","events_url":"https://api.github.com/users/jedzej/events{/privacy}","received_events_url":"https://api.github.com/users/jedzej/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jedzej/tietopythontraining-basic","description":null,"fork":false,"url":"https://api.github.com/repos/jedzej/tietopythontraining-basic","forks_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/forks","keys_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/teams","hooks_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/hooks","issue_events_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/issues/events{/number}","events_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/events","assignees_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/assignees{/user}","branches_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/branches{/branch}","tags_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/tags","blobs_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/git/refs{/sha}","trees_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/statuses/{sha}","languages_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/languages","stargazers_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/stargazers","contributors_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/contributors","subscribers_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/subscribers","subscription_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/subscription","commits_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/commits{/sha}","git_commits_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/git/commits{/sha}","comments_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/comments{/number}","issue_comment_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/issues/comments{/number}","contents_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/contents/{+path}","compare_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/merges","archive_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/downloads","issues_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/issues{/number}","pulls_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/pulls{/number}","milestones_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/milestones{/number}","notifications_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/labels{/name}","releases_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/releases{/id}","deployments_url":"https://api.github.com/repos/jedzej/tietopythontraining-basic/deployments","created_at":"2018-01-19T12:23:02Z","updated_at":"2018-03-16T13:06:26Z","pushed_at":"2018-03-16T13:19:15Z","git_url":"git://github.com/jedzej/tietopythontraining-basic.git","ssh_url":"git@github.com:jedzej/tietopythontraining-basic.git","clone_url":"https://github.com/jedzej/tietopythontraining-basic.git","svn_url":"https://github.com/jedzej/tietopythontraining-basic","homepage":null,"size":525,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":77,"mirror_url":null,"archived":false,"open_issues_count":43,"license":null,"forks":77,"open_issues":43,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jedzej/tietopythontraining-basic/pulls/235"},"html":{"href":"https://github.com/jedzej/tietopythontraining-basic/pull/235"},"issue":{"href":"https://api.github.com/repos/jedzej/tietopythontraining-basic/issues/235"},"comments":{"href":"https://api.github.com/repos/jedzej/tietopythontraining-basic/issues/235/comments"},"review_comments":{"href":"https://api.github.com/repos/jedzej/tietopythontraining-basic/pulls/235/comments"},"review_comment":{"href":"https://api.github.com/repos/jedzej/tietopythontraining-basic/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jedzej/tietopythontraining-basic/pulls/235/commits"},"statuses":{"href":"https://api.github.com/repos/jedzej/tietopythontraining-basic/statuses/4a90c9adddffceb0aa15e9a332a37bbe049e13c8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"kadilak83"}}