LoginSignup
0
0

Pythonの一言基礎用語集

Last updated at Posted at 2024-01-02

用語集(terms)

値(value)

・プログラム内で扱われるデータ。様々なデータ型が存在する。

データ型
データ型 日本語
str 文字型 str = 'Hello World.'
int 整数型 int = 1
float 浮動小数点型 float = 1.0
bool ブール型, 正誤 flg = True
datetime 日付型 date = datetime.datetime(2024,1,7,22,0,0)
list リスト型, 配列 list = [0,1,2]
tuple タプル型(変更不能) tuple = (0,1,2)
dictionary 辞書型 dict = {'a':0, 'b':1, 'c':2}
変数

を定義(格納)したもの。

a = value
属性

オブジェクトに付与されていて、"オブジェクト.属性名"で参照される

オブジェクト(object)

属性 or と、メソッドをもつデータ

クラス

オブジェクトを作成するための処理の型

class ClassName:
    x = 0
    y = 0
    def MethodName(self, a, b):
        self.x = a
        self.y = b
関数

・呼び出し時にを返す一連の文のこと

メソッド

クラスの中で定義された関数。第一引数にはselfを入れて自身のインスタンスを参照させる。

class ClassName:
    x = 0
    y = 0
    def MethodName(self, a, b):
        self.x = a
        self.y = b
引数(argument)

関数メソッドに渡すのこと

インスタンス

クラスを代入した変数

instance = ClassName()

参考サイト

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