프로그래밍 문법/python

자료형

씩씩한 IT블로그 2020. 6. 19. 20:42
반응형

자료형

Collection

Mutable

Ordered

Duplication

Notation

Description

Empty Collection

string

no

yes

yes

" "

"simple string"

s = '' or s = ""

list

yes

yes

yes

[ ]

[ ["item0_0", 12 ], ["item1_0", 22 ] ]

l = []

tuple

no

yes

yes

( )

( ["item0_0", 12 ], ["item1_0", 22 ] )

t = ()

set

yes

no

no

{ }

{ 1, 2, 3, 4, 5 }

S = set()

dictionary

yes

no

no

{ }

{ 'one' : 1, 'two' : 2, 'three' : 3 }

d = {}

반응형