{"push_id":920777575,"size":3,"distinct_size":1,"ref":"refs/heads/master","head":"095bf79f3f7478059355c1177deedf323fe7194f","before":"68617cfacf79f78097d381eee7933abace9a17db","commits":[{"sha":"1b2ef67b22efede9aabb7e69d0f95237793c39d0","author":{"email":"17db7a5e3dce32104953b744a6713939eee4fcef@yahoo.co.in","name":"vasant-prabhu"},"message":"Create collatz-sequence\n\n# Write a function named collatz() that has one parameter named number.\r\n# If number is even, then collatz() should print number // 2 and\r\n# return this value. If number is odd, then collatz() should print\r\n# and return 3 * number + 1.\r\nimport sys\r\ndef collatz(number):\r\n    if number%2==0:\r\n        return(number//2)\r\n    else:\r\n        return((number*3)+1)\r\n\r\n# Then write a program that lets the user type in an integer and\r\n# that keeps calling collatz() on that number until the function\r\n# returns the value 1.\r\nprint('Enter a number of your choice')\r\ntry:\r\n    mychoice = int(input())\r\nexcept ValueError:\r\n    print('plzz enter only integers')\r\n    sys.exit()\r\nprint('The value is ',str(mychoice))\r\nanswer=0\r\nwhile answer != 1:\r\n    answer = collatz(mychoice)\r\n    mychoice=answer\r\n    print(str(answer))","distinct":false,"url":"https://api.github.com/repos/vasant-prabhu/python-stuff/commits/1b2ef67b22efede9aabb7e69d0f95237793c39d0"},{"sha":"325265a11c4fcf736d7184e0914ecc2cfd40bddb","author":{"email":"17db7a5e3dce32104953b744a6713939eee4fcef@yahoo.co.in","name":"vasant-prabhu"},"message":"Update collatz-sequence","distinct":false,"url":"https://api.github.com/repos/vasant-prabhu/python-stuff/commits/325265a11c4fcf736d7184e0914ecc2cfd40bddb"},{"sha":"095bf79f3f7478059355c1177deedf323fe7194f","author":{"email":"17db7a5e3dce32104953b744a6713939eee4fcef@yahoo.co.in","name":"vasant-prabhu"},"message":"Merge pull request #1 from vasant-prabhu/vasant-prabhu-patch-collatz\n\nVasant prabhu patch collatz","distinct":true,"url":"https://api.github.com/repos/vasant-prabhu/python-stuff/commits/095bf79f3f7478059355c1177deedf323fe7194f"}]}