CodeSnippetsã®Pythonã«ãã´ãªãã¼ã¼ã£ã¨çºãã¦ããé¢ç½ãæ¸ãæ¹ãè¦ã¤ãã¾ããã http://www.bigbold.com/snippets/tag/python/ ãããªã¹ãã®éé ãå¾ããæããµã¤ããããªæã㧠>> a = [1, 2, 3, 4, 5, 6] >> a.reverse() >> print a [6, 5, 4, 3, 2, 1] æ¸ãã¾ãããreverseã¯ç ´å£çã¡ã½ãããªã®ã§å ´åã«ãã£ã¦ã¯ã¤ã¤ã³ãªæããã§ãã次ã®ããã«ããã°å¤§ä¸å¤«ã >> a = [1, 2, 3, 4, 5, 6] >> a[::-1] [6, 5, 4, 3, 2, 1] ã¡ãªã¿ã«ãa[::2]ã ã¨[1, 3, 5]ãa[::3]ã ã¨[1,4]ãè¿ã£ã¦ãã¾ããåãã¦ç¥ã£ããã¡ãã£ã¨ãããããã ã§ãããã使ã£ã¦ã¡ãã£ã¨ã³ã¼ãæ¸ãã¦ã¿ãããªã£ãã®ã§(æ段ã®ããã«ç®çããããã)
{{#tags}}- {{label}}
{{/tags}}