<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mio_kt</author_name>
  <author_url>https://blog.hatena.ne.jp/mio_kt/</author_url>
  <blog_title>miok’s diary</blog_title>
  <blog_url>https://mio-kt.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>第二章 : 14 先頭からN行目を出力 自然数Nをコマンドライン引数などの手段で受け取り，入力のうち先頭のN行だけを表示せよ．確認にはheadコマンドを用いよ． コードはこんな感じ。 file = 'hightemp.txt' N = 4 with open(file) as f: for i, line in enumerate(f): if i &lt; N: line = line.rstrip() print(line) enumerate()関数を使うとfor文回すときに中身とインデックスを両方取得できるので便利ですね。 line.rstrip()のところは改行コードを削除するために使って…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmio-kt.hatenablog.com%2Fentry%2F2017%2F01%2F11%2F093124&quot; title=&quot;14 : 言語処理100本ノックでPythonのお勉強 - miok’s diary&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>2017-01-11 09:31:24</published>
  <title>14 : 言語処理100本ノックでPythonのお勉強</title>
  <type>rich</type>
  <url>https://mio-kt.hatenablog.com/entry/2017/01/11/093124</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
