numbers=[] count=0 for c in list: if c==c: count=count+1 numbers.append(count)
なぜこれでうまくいかないのでしょうか?
よろしくお願いします。
コード def count(things): counts = {} for x in things: if x not in counts: counts[x] = 0 counts[x] = counts[x] + 1 return counts
答えです
このままではコードが読めないので、質問を編集し、<code>ボタンを押し、出てくる’’’の枠の中にコードを貼り付けてください
回答5件
あなたの回答
tips
プレビュー
