{"action":"created","issue":{"url":"https://api.github.com/repos/letylin/pyprogbook/issues/12","repository_url":"https://api.github.com/repos/letylin/pyprogbook","labels_url":"https://api.github.com/repos/letylin/pyprogbook/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/letylin/pyprogbook/issues/12/comments","events_url":"https://api.github.com/repos/letylin/pyprogbook/issues/12/events","html_url":"https://github.com/letylin/pyprogbook/issues/12","id":186545620,"node_id":"MDU6SXNzdWUxODY1NDU2MjA=","number":12,"title":"關於ch4的作業","user":{"login":"wangwinlin","id":22324214,"node_id":"MDQ6VXNlcjIyMzI0MjE0","avatar_url":"https://avatars1.githubusercontent.com/u/22324214?v=4","gravatar_id":"","url":"https://api.github.com/users/wangwinlin","html_url":"https://github.com/wangwinlin","followers_url":"https://api.github.com/users/wangwinlin/followers","following_url":"https://api.github.com/users/wangwinlin/following{/other_user}","gists_url":"https://api.github.com/users/wangwinlin/gists{/gist_id}","starred_url":"https://api.github.com/users/wangwinlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wangwinlin/subscriptions","organizations_url":"https://api.github.com/users/wangwinlin/orgs","repos_url":"https://api.github.com/users/wangwinlin/repos","events_url":"https://api.github.com/users/wangwinlin/events{/privacy}","received_events_url":"https://api.github.com/users/wangwinlin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-01T14:21:02Z","updated_at":"2018-09-27T08:31:26Z","closed_at":null,"author_association":"NONE","body":"問題一:第7題給的答案，第3行next(lis1)是否不用打?因題目所要求的是要輸出「第一個」資料\r\n回:\r\n lis1=['1101','1102','1210']\r\nlis1=enumerate(lis1)\r\nprint(next(lis1))\r\n第3列有print可印出結果: (0, '1101')\r\n\r\n問題二:接續問題一第7題給的答案，第4行給的標準答案是x=list(next(lis1))但若把list拿掉為x=next(lis1)輸出的答案差在括號\r\n回: \r\nlis1=['1101','1102','1210']\r\nlis1=enumerate(lis1)\r\nx=list(next(lis1))\r\nprint(x)\r\n印出x的結果: [0, '1101'], 與問題一的結果差在, 問題1以tuple資料型別儲存, 而問題二的結果以listi資料型別儲存。\r\n\r\n問題三:第9題題目敘述「利切片」是甚麼意思?而給的答案，第5行和第6行的意思是甚麼?另外，我按照上面的答案打，輸出的答案卻非常奇怪\r\n回: 切片是slice()函數, 用法在93頁, 表4-6將傳入的資料切段。\r\nimport random\r\nlis1=list(range(1,15,2))\r\nlis1=lis1[slice(0,5,1)]\r\nprint(lis1)\r\nnum=random.randint(1,5)\r\nprint(num)\r\nprint(lis1[num-1])\r\n結果: \r\n[1, 3, 5, 7, 9]\r\n3\r\n5\r\nlis1的序列是[1, 3, 5, 7, 9], 亂數產生1-5的整數為3, 則取出lis1中(3-1)即第2個值為5. \r\n以上的程式碼只是多用print印出print(lis1), print(num), 其餘與公告的解答相同. \r\n\r\n問題四:按照答案打，覺得輸出的答案很怪\r\n[](url\r\n![1477844238768](https://cloud.githubusercontent.com/assets/22324214/19892743/70699e64-a081-11e6-9af5-3c5d76c84a67.jpg)\r\n![1478009754418](https://cloud.githubusercontent.com/assets/22324214/19892745/709b9bbc-a081-11e6-87de-c72dde7cd83c.jpg)\r\n\r\n)\r\n回: 這要當面討論, 才會知道你的問題在那裡?\r\n"},"comment":{"url":"https://api.github.com/repos/letylin/pyprogbook/issues/comments/425005377","html_url":"https://github.com/letylin/pyprogbook/issues/12#issuecomment-425005377","issue_url":"https://api.github.com/repos/letylin/pyprogbook/issues/12","id":425005377,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTAwNTM3Nw==","user":{"login":"letylin","id":20430722,"node_id":"MDQ6VXNlcjIwNDMwNzIy","avatar_url":"https://avatars1.githubusercontent.com/u/20430722?v=4","gravatar_id":"","url":"https://api.github.com/users/letylin","html_url":"https://github.com/letylin","followers_url":"https://api.github.com/users/letylin/followers","following_url":"https://api.github.com/users/letylin/following{/other_user}","gists_url":"https://api.github.com/users/letylin/gists{/gist_id}","starred_url":"https://api.github.com/users/letylin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/letylin/subscriptions","organizations_url":"https://api.github.com/users/letylin/orgs","repos_url":"https://api.github.com/users/letylin/repos","events_url":"https://api.github.com/users/letylin/events{/privacy}","received_events_url":"https://api.github.com/users/letylin/received_events","type":"User","site_admin":false},"created_at":"2018-09-27T08:31:26Z","updated_at":"2018-09-27T08:31:26Z","author_association":"OWNER","body":"github的討論參與者您好！\r\n您在這邊的留言我們比較難在第一時間收到資訊，\r\n所以在這邊邀請您加入我們的LINE@ 1對1聊天群組，\r\n您可以在LINE上討論有關於書中的問題，\r\n讓我們能快速知道您的疑問並與您討論！\r\n\r\nLINE@ID：@iex5378o\r\n★☆★使用手機者點選以下網址或使用電腦者掃描以下QRCode立即加入群組★☆★\r\nhttps://line.me/R/ti/p/%40iex5378o\r\n \r\n![line](https://user-images.githubusercontent.com/20430722/46133100-4be29180-c272-11e8-93e4-cba599cc4ccc.jpg)"}}
{"actor":{"display_login":"letylin"}}