Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
配列内の文字の値を取得しようとしています。私が持っている配列は次のとおりです。
a = ["a","b","c","d","e","f","g","h"].
文字の値を取得する場合、コードは次のとおりです。
?a
しかし、試し?a[5]てみると、 0. なぜこれが事実なのか誰にも分かりますか?
?a[5]
0
--1.8.7を使用していることを明確にして申し訳ありません:)
これは、結合性/優先順位によるものです。ではなく として?a[5]解釈されます。後者だと思っていたのですが、実は前者です。(?a)[5]?(a[5])
(?a)[5]
?(a[5])