<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hanabusa-snow</author_name>
  <author_url>https://blog.hatena.ne.jp/hanabusa-snow/</author_url>
  <blog_title>プログラ生活</blog_title>
  <blog_url>https://www.pon-x.jp/</blog_url>
  <categories>
    <anon>Python</anon>
    <anon>プログラミング</anon>
  </categories>
  <description>www.pon-x.jp 今回は、繰り返しを用いた簡単なリストの作り方である、リスト内包表記を紹介します。 リスト内包表記 まず、通常のfor文を使って、0から9までのリストを作成してみます。 r = [] for i in range(10): r.append(i) r この通り、できました。 では、リスト内包表記を使ってみるとこんな感じに1行で書けます。 r = [i for i in range(10)] r この通り、さきほどと同じ結果が得られます。 if分も使えます 例えば、20未満の整数で3の倍数だけを取り出すとき、こんな風に書けます。 ※ あえて、forとifをつかってますが、…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.pon-x.jp%2Fentry%2F2021%2F05%2F26%2F083935&quot; title=&quot;【Python連載】リスト内包表記 -013- - プログラ生活&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>https://cdn-ak.f.st-hatena.com/images/fotolife/h/hanabusa-snow/20210526/20210526083234.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-05-26 08:39:35</published>
  <title>【Python連載】リスト内包表記 -013-</title>
  <type>rich</type>
  <url>https://www.pon-x.jp/entry/2021/05/26/083935</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
