# 文字列の定義 s = 'foo' # 文字列リテラルはシングルクオート/ダブルクオートなどで囲む print('s:', s) # 'foo' s = str([0, 1, 2]) # str関数は他のオブジェクトの文字列表現を作成する print('s:', s) # '[0, 1, 2]' # リストの定義 l = ['foo', 'bar'] # リストリテラルは[]で囲む print('l:', l) # ['foo', 'bar'] l = list('foo') # list関数に文字列(反復可能オブジェクト)を渡す print('l:', l) # ['f', 'o', 'o'] # タプルの定義 t = (0, 1, 2) # タプルリテラルは()で囲む print('t:', t) # (0, 1, 2) t = () # 空のタプル print