[python 기초] python의 tuple에 대하여
TupleTuple은 ()를 통해 만들거나, ","를 이용하여 만들 수 있다. 123456789101112131415161718192021222324a = 1b = 1,print(type(a), a) # 1print(type(b), b) # (1,) c = 4 * (20+5)d = 4 * (20+5,)print(type(c), c) # 100print(type(d), d) # (25, 25, 25, 25) e = [1, 2, 3]f = tuple(e)print(type(e), e) # [1, 2, 3]print(type(f), f) # (1, 2, 3) print(list('hello')) # ['h', 'e', 'l', 'l', 'o']print(tuple('hello')) # ('h', 'e', 'l..
2018. 6. 27.