<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>side_tana</author_name>
  <author_url>https://blog.hatena.ne.jp/side_tana/</author_url>
  <blog_title>暮らしの技術</blog_title>
  <blog_url>https://tech-blog.tanatana.info/</blog_url>
  <categories>
  </categories>
  <description>なんかビット表現に変えて文字列にしてsplitするみたいな荒技でもいいんだけど，ちゃんとしたらこういう感じかな．対象とする数値を表現するのに何桁いるか調べて，そのうえで各桁のマスクを格納したリストを作る．マスクリストの各要素と対象とする数値のAND演算をして0意外が帰ってきた回数を調べる． import sys import math def createMasks(n): maskList = [] for x in range(n): maskList.append(int(math.pow(2, x))) return maskList def hasNFlags(flags, n): …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftech-blog.tanatana.info%2Fentry%2F2014%2F11%2F07%2F194631&quot; title=&quot;pythonでm個のbitがたっている数値をn以下で調べる - 暮らしの技術&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2014-11-07 19:46:31</published>
  <title>pythonでm個のbitがたっている数値をn以下で調べる</title>
  <type>rich</type>
  <url>https://tech-blog.tanatana.info/entry/2014/11/07/194631</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
