0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

みんなのPythonを読んで(書き途中)

0
Last updated at Posted at 2016-02-07

とりあえずメモ的に殴り書き(あとでまとめます)

Chapter1

  • Pythonでは、ブロックはインデントで定義される
  • Pythonで扱うデータはすべてオブジェクト
  • Pythonのスクリプトファイルは拡張子を「.py」にするのがよい>windowsなら勝手に関連付けされるから
  • ファイルの文字コードはUTF8にする。sjisじゃあ動かなかった…
  • 「#」から始まる行はコメント
  • Linux、MacOS Xでは最初の行に、「#!/usr/bin/env python3」
  • おすすめされたIDE「PyScripter」「EclipseのPython用プラグイン(PyDev)」
  • Pythonは、代入を行うことで新しい変数を作るので、Pythonは、変数の宣言が不要。
  • Python3から変数名に日本語がつかえるようになった>ただし特別な理由がない限り変数名は英数字がよい。
Pythonの処理の考え方
>>> b = b + 1

まず、[b=」という部分を見て、新しい変数を定義しようとします。次に、新しい変数bのなかに何を入れればよいかを考えます。イコールの右側にはbという変数がありますが、この時点では変数は定義されていません。結果として「'b'という変数は未定義です」というエラーを出力するのです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?