カウント

PythonでThe Most Wanted Letter

コード3 def checkio(text): s = text.lower() print max("abcdefghijklmnopqrstuvwxyz", key=s.count) コード2 import string def checkio(text): s = text.lower() return max(string.ascii_lowercase, key=s.count) 一言 max()を忘れていた、公式ドキュ…

PythonでNon Unique Elements

コード def checkio(data): c = [] for i in data: if data.count(i) >= 2: c.append(i) print c 参考にしたサイト python count 要素の確認(in演算子, indexメソッド, countメソッド) - リスト - Python入門

PythonでBinary count

コード def checkio(number): print bin(number).count("1") 参考にしたサイト python bin bin(x) SubLimetext3 Non-ASCII character pythonで「SyntaxError: Non-ASCII character」のエラーが出た場合の対処方法 python count 要素の確認(in演算子, indexメ…