Python/python 기초

내장 데이터 유형 (Built-in Datatypes)

DS지니 2021. 4. 2. 20:12
728x90
반응형

내장 데이터 유형 (Built-in Datatypes)

Text Type
(텍스트유형)
str x = "Hello World"
Numeric Types
(숫자 유형)
int x = 29
float x = 20.5, z = -87.7e100
complex x = jj3
Sequence Types
(시퀀스 유형)
list x = ["Tiger", "Bear", "Monkey"]
tuple x = ("Tiger", "Bear", "Monkey")
range x = range(10)
Mapping Type
(매핑 유형)
dict x = {"name" : "John", "age" : 29}
Set Types
(세트 유형)
set x = {"Tiger", "Bear", "Monkey"}
frozenset x = frozenset({"Tiger", "Bear", "Monkey"})
Boolean Type
(불린 유형)
bool x = True
Binary Types
(바이너리 유형)
bytes x = b"Hello"
bytearray x = bytearray(5)
memoryview x = memoryview(bytes(5))

 

728x90
반응형

'Python > python 기초' 카테고리의 다른 글

Format  (0) 2021.04.02
문자열 수정(Modify Strings)  (0) 2021.04.02
변수 할당하는 방법 3가지  (0) 2021.04.02
변수 이름 지정하는 방법 3가지  (0) 2021.04.02
전역변수(Global Variable), 지역변수(Local Variable)  (0) 2021.04.02