くだすれPython(超初心者用) その36at TECH
くだすれPython(超初心者用) その36 - 暇つぶし2ch100:94
18/01/16 23:50:04.19 1yOH1J8J.net
94 の続きに、以下を付け足して
results = groups.each_with_object({}) do |(num, ary), h|
scores.each_with_index do |num2, i|
if num == num2
if h[num]
h[num] <<= i
else
h[num] = [i]
end
end
end
end
p results
出力
{2=>[1, 3, 9], 3=>[4, 7, 8]}


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch