====== python의 data type을 알아 볼까요 ====== https://docs.python.org/3/library/stdtypes.html ===== Built-In type ===== === Boolean === * bool === Numeric === * int * float * complex === String === * str === Sequence === * list * tuple * range === Set === * set * frozenset === Mapping === * dict === Iterator === *___iter__() *___next___() ==== Hello World! ==== # numeric a = -1 b = 1.0 print(f"{type(a)} {a}") print(f"{type(b)} {b}") c = complex(101, 2) print(f"{type(c)} {c}") # string s1 = """0123456789-abcd""" print(f"{type(s1)} {s1} {s1[0::5]}") # boolean print(f"{type(False)} {True} {1 != 1}") # List kk = ['k', 'asdf', "김재성"] print(f"{type(kk)} {kk}") # Tuple kk = ('k', 'asdf', "김재성") print(f"{type(kk)} {kk}") # Dictionary kk = {'name':'maro', 'nation':'Korea'} print(f"{type(kk)} {kk}, len: {len(kk)}") ** output ** -1 1.0 (101+2j) 0123456789-abcd 05- True False ['k', 'asdf', '김재성'] ('k', 'asdf', '김재성') {'name': 'maro', 'nation': 'Korea'}, len: 2