※だいぶざっくりとしてるのでコメントwelcomeです
スライスには引数が3つ埋め込めるらしい。
始点、終点、飛ばし数の3つ。
2つだけだと思ってました。
そもそも引数っていう言い方が違う気がする。
cf) 他の方のQiita記事
a = [1,2,3,4,5,6,7,8,9]
print(a[1::2])
これで[2,4,6,8]と出力された。
Go to list of users who liked
More than 3 years have passed since last update.
※だいぶざっくりとしてるのでコメントwelcomeです
スライスには引数が3つ埋め込めるらしい。
始点、終点、飛ばし数の3つ。
2つだけだと思ってました。
そもそも引数っていう言い方が違う気がする。
cf) 他の方のQiita記事
a = [1,2,3,4,5,6,7,8,9]
print(a[1::2])
これで[2,4,6,8]と出力された。
Register as a new user and use Qiita more conveniently
Go to list of users who liked