# 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
<class 'int'> -1 <class 'float'> 1.0 <class 'complex'> (101+2j) <class 'str'> 0123456789-abcd 05- <class 'bool'> True False <class 'list'> ['k', 'asdf', '김재성'] <class 'tuple'> ('k', 'asdf', '김재성') <class 'dict'> {'name': 'maro', 'nation': 'Korea'}, len: 2