<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>aisakakun</author_name>
  <author_url>https://blog.hatena.ne.jp/aisakakun/</author_url>
  <blog_title>週末副業記</blog_title>
  <blog_url>https://infoaisaka.hatenablog.com/</blog_url>
  <categories>
    <anon>その他プログラミング</anon>
  </categories>
  <description>今回は、配列の中に複数個存在する数字以外は配列から削除するというプログラムです。 例えば、このような配列 a = [1,2,3,4] だと、出力は a = [] となるようにするということです。 この問題を見て最初に思いついたのがこちら In [2]: def test(data): ...: for i in data: ...: if data.count(i) &lt; 2: ...: data.remove(i) ...: return data これでいけそうな気もするのですが、 これで In [3]: a = [1,2,3,4] というのを引数とすると、 In [4]: test(a) …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Finfoaisaka.hatenablog.com%2Fentry%2Fpython_numCount&quot; title=&quot;配列にある数字の数を数える[Python 3.0] - 週末副業記&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>http://cdn-ak.f.st-hatena.com/images/fotolife/a/aisakakun/20160305/20160305111529.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2016-03-05 12:00:00</published>
  <title>配列にある数字の数を数える[Python 3.0]</title>
  <type>rich</type>
  <url>https://infoaisaka.hatenablog.com/entry/python_numCount</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
