파이썬의 자료형
float = 실수
string = 문자형
1
| str_data1 ='hello world'
|
list [ ] 변경 가능 / tuple ( ) 변경 불가 / dict {}
1
| list_data = [1,2,3,4,5,6,7,8,9,10]
|
1
| tuple_data = (1,2,3,4,5,6,7,8,9,10)
|
1
| dict_data = {0:'toy',1:'book'}
|
Variable Type Data/Info
-----------------------------------
complex_data complex (1+5j)
dict_data dict n=2
float_data float 3.14
float_data2 float 3.0
int_data int 3
list_data list n=10
str_data1 str hello world
tuple_data tuple n=10
1 2 3 4 5 6 7 8 9
| a=123 a=-1123 a=0
a=1.2 a=4.24E10 a=4.24e10 b=4.24e-10
|
Variable Type Data/Info
-----------------------------------
a float 42400000000.0
b float 4.24e-10
complex_data complex (1+5j)
dict_data dict n=2
float_data float 3.14
float_data2 float 3.0
int_data int 3
list_data list n=10
str_data1 str hello world
tuple_data tuple n=10
Once deleted, variables cannot be recovered. Proceed (y/[n])? y
Interactive namespace is empty.
1 2 3 4
| a=3 b=4 print(a+b) print(7%3)
|
7
1
문자열
1 2
| a= "hello 'my' world" b= 'hello "my" world'
|
Variable Type Data/Info
----------------------------
a str hello 'my' world
b str hello "my" world
1 2 3 4 5 6 7
| a= """ P "" 'O' "" """ print(a)
|
P
""
'O'
""
1 2 3 4
| a="my" b="note" c=a+"_"+b print(c)
|
my_note
my_note/my_note/my_note/my_note/my_note/
2