<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hayataka2049</author_name>
  <author_url>https://blog.hatena.ne.jp/hayataka2049/</author_url>
  <blog_title>静かなる名辞</blog_title>
  <blog_url>https://hayataka2049.hatenablog.jp/</blog_url>
  <categories>
    <anon>python</anon>
    <anon>Tips</anon>
    <anon>リスト内包表記</anon>
  </categories>
  <description>問題設定 想定しているのは、たとえばこんなシチュエーションです。 s = &quot;hoge! 1234&quot; tmp = s.split() lst = [tmp[0], int(tmp[1])] 要するに、比較的短いリストだが性質の違うものが入っており、それぞれ違う処理をして返したいのです。 それだけなら良いのですが、上の例だとs.split()の結果を一時変数に入れないとどうしようもないので（二回呼ぶと再計算されてしまう）、まどろっこしいことになります。ここでリスト内包を使おうとしても、まともな処理は書けません（ん、zipでlambdaと一緒に回せばできなくはないか）。 （私が思いつく）解決策は2つ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhayataka2049.hatenablog.jp%2Fentry%2F2018%2F04%2F27%2F235805&quot; title=&quot;【python】リストの各要素に違う処理をする - 静かなる名辞&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>2018-04-27 23:58:05</published>
  <title>【python】リストの各要素に違う処理をする</title>
  <type>rich</type>
  <url>https://hayataka2049.hatenablog.jp/entry/2018/04/27/235805</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
