Pythonのお勉強 Part33at TECH
Pythonのお勉強 Part33 - 暇つぶし2ch33:デフォルトの名無しさん
09/05/04 11:40:56
Pythonは超初心者だけど、こんな感じかな?

str1 = format(15, 'b')
str2 = format(9, 'b')
count = 0
i = 0
while i < len(str1):
if str1[i] == str2[i]:
count += 1
i += 1
print count


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