🖥

Example of deleting specific value from array of # python (I want to s

2019/04/12に公開

<h1> python </h1>

<p> It seems to be easy to handle once it is set = set. It is unclear whether it is a good way. </p>

<pre> <code class="py">>>> list(set(["a","b","c","d","e"]) - set(["b","d"]))
['a', 'e', 'c']
</code> </pre>

<h1> ruby </h1>

<p> You can subtract with the array.
<code>rb
[1] pry(main)> ["a","b","c","d","e"] - ["b", "d"]
=> ["a", "c", "e"]
</code> </p>

<h1> ref </h1>

<p> <a href="https://qiita.com/Tocyuki/items/0bc783daab382ef7a0ec">Python set operations-Qiita</a> </p>

Original by Github issue

https://github.com/YumaInaura/YumaInaura/issues/1222

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

https://line.me/ti/g2/eEPltQ6Tzh3pYAZV8JXKZqc7PJ6L0rpm573dcQ

Twitter

https://twitter.com/YumaInaura

公開日時

2019-04-12

Discussion