{"action":"closed","issue":{"url":"https://api.github.com/repos/howtome/Learning-Python/issues/1","repository_url":"https://api.github.com/repos/howtome/Learning-Python","labels_url":"https://api.github.com/repos/howtome/Learning-Python/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/howtome/Learning-Python/issues/1/comments","events_url":"https://api.github.com/repos/howtome/Learning-Python/issues/1/events","html_url":"https://github.com/howtome/Learning-Python/issues/1","id":204249855,"number":1,"title":"collatz序列.py","user":{"login":"howtome","id":14357954,"avatar_url":"https://avatars.githubusercontent.com/u/14357954?v=3","gravatar_id":"","url":"https://api.github.com/users/howtome","html_url":"https://github.com/howtome","followers_url":"https://api.github.com/users/howtome/followers","following_url":"https://api.github.com/users/howtome/following{/other_user}","gists_url":"https://api.github.com/users/howtome/gists{/gist_id}","starred_url":"https://api.github.com/users/howtome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/howtome/subscriptions","organizations_url":"https://api.github.com/users/howtome/orgs","repos_url":"https://api.github.com/users/howtome/repos","events_url":"https://api.github.com/users/howtome/events{/privacy}","received_events_url":"https://api.github.com/users/howtome/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-31T10:01:26Z","updated_at":"2017-01-31T10:02:07Z","closed_at":"2017-01-31T10:02:07Z","body":"import sys\r\ndef collatz(number):\r\n    if number%2 == 0:\r\n        number = number//2\r\n    else:\r\n        number = 3*number+1\r\n\r\n    print(number)\r\n    return number\r\n\r\ntry:\r\n    numbers = int(input())\r\nexcept ValueError:\r\n    print(\"请输入整数！\\n eg.100\")\r\n\r\nwhile True:\r\n    if numbers != 1:\r\n        numbers = collatz(numbers)\r\n    elif numbers == 1:\r\n        print(numbers)\r\n        sys.exit()\r\n"}}
{"actor":{"display_login":"howtome"}}