{"blog_url":"https://potisan-programming-memo.hatenablog.jp/","title":"Python slice\u2192\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u30bf\u30d7\u30eb\u5909\u63db","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpotisan-programming-memo.hatenablog.jp%2Fentry%2F2025%2F03%2F29%2F180125\" title=\"Python slice\u2192\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u30bf\u30d7\u30eb\u5909\u63db - potisan\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30e1\u30e2\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","categories":["Python 3"],"author_name":"potisan","version":"1.0","url":"https://potisan-programming-memo.hatenablog.jp/entry/2025/03/29/180125","image_url":null,"published":"2025-03-29 18:01:25","width":"100%","description":"[start:stop:step]\u7b49\u3067\u4f5c\u6210\u3055\u308c\u308bslice\u306f\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u30bf\u30d7\u30eb\u306b\u5909\u63db\u3067\u304d\u307e\u3059\u3002__getitem__\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u88c5\u3059\u308b\u5834\u5408\u306b\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002 len = 50 # \u30b7\u30fc\u30af\u30a8\u30f3\u30b9\u306e\u9577\u3055\u306a\u3069\u3092\u6307\u5b9a tuple(range(len)[10:100:5]) # (10, 15, 20, 25, 30, 35, 40, 45) range.indices\u3092\u4f7f\u3048\u3070\u4e0b\u8a18\u306e\u30b3\u30fc\u30c9\u3082\u66f8\u3051\u307e\u3059\u304c\u3001\u4e0a\u8a18\u3088\u308a\u5c11\u3057\u8aad\u307f\u306b\u304f\u304f\u306a\u308a\u3001*\u306b\u3088\u308b\u30a2\u30f3\u30d1\u30c3\u30af\u3092\u631f\u307f\u307e\u3059\u3002 len = 50 tuple(range(*slice(10,100,5).indices(len))) # (10, 15, 2\u2026","provider_name":"Hatena Blog","type":"rich","height":"190","author_url":"https://blog.hatena.ne.jp/potisan/","blog_title":"potisan\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30e1\u30e2","provider_url":"https://hatena.blog"}