2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Python】毎週勉強するシリーズ ~変数・定数~

Last updated at Posted at 2025-02-20

概要

AI が流行ってる昨今 Python は必須級のスキルになってきてます。
時代に取り残されないようにコツコツと Python を勉強しようと思います!
三日坊主にならないように Qita でアウトプットしながら進めます💪

今日やること

とほほのPython入門 - 変数・定数 を理解する。

変数について

Python の 変数 は、アンダーバー(_)を含む英数字からなる名前で表します。
最初の1文字はアンダーバー(_)または英字でなくてはなりません。

value1 = 123
_value1 = 123
test_value = 123
TEST_VALUE = 123

定数について

Python では 定数 はサポートされていません。
慣習的に大文字とアンダーバー(_)のみの変数が固定値を表現することが多いようです。

PI = 3.14
MAX_BUFFER_SIZE = 1024

定数がないのは結構特徴的ですね。
僕が触った言語はすべて定数があったので、実際の使い勝手は気になるところです。

感想

今日はさくっと終わりましたね!
定数ないのは意外でしたがこれも慣れですね~

今回も見ていただきありがとうございました。
また次回お会いしましょう!!

次回やること

とほほのPython入門 - リスト・タプル・辞書 を理解する。

2
3
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
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?