Home
Null Section
Cancel

Python 7 - Method

이거 전에 Concept 참고. Method python에서는 method, function둘 다 사용. # def name(params): # statement # return ... def temp(param1, param2): print(param1, param2) return param1 + p...

Concept

python 쓰다가 갑자기 궁금해서 찾았는데 거기쓰긴 좀더 넓은 의미로 알아뒀음해서 옮김 Method / Function name discription Function 실행 가능한 코드 조각 Method class안...

Python 6 - Control Flow

if 조건문 근본 # if [condition] : # statement # elif [condition] : # statement # else : # statement someCondition = 1024 if someCondition == 0: print("0") elif someCondition > 0 ...

Python 5 - IO

Input input() 으로 해결 data = input() print(data) data = input("only numeric\n") print(type(data)) print(data) asdf asdf only numeric 1234 <class 'str'> 1234 input으로 받는데 input에 필요한 문...

dict

Init mapping - mutablemapping 계통으로 하위 type으로 dict가 유일함. key, value, item으로 구성되며 {key : value} 쌍이 기본 구조이고 이 쌍을 item이라 함. 변경가능한 hash table 구조이며 hash가능하지 않은값으로 mutable은 key로 사용할 수 없음. 괄호는...

Type Inheritance

Init 여기 쓸 내용이 정확한지, 쓸만한 내용인지 모르겠음.. int, float, complex, None은 상속관계가 없다. bool은 int의 subclass. 그 외 나머지 type인 dict, str, memoryview, tuple, list, bytes, bytearray, set, frozenset은 Ite...

Operators

Init python에서는 7개 그룹의 연산자가 있음 Arithmetic operators Assignment operators Comparison operators Logical operators Identity operators Membership operators ...

Python 4 - Variable & Data Type 2

string 문자열 처리가 다른 언어보다 간단하고 직관적 문자 표시로 " "나 ' '나 상관없는듯. 단, 짝은 맞게.. 이 관련은 앞에 pep8에도 있음. 블록 전체를 string으로 하려면 ''' '''하면 되는데 이게 docstring아닌지? 문자 * 숫자로 문자 반복을 할 수 있음 print(“0” * 3) ...

Numeric, Bool, None

Numeric 대충 숫자 관련. int, float, complex가 있음. bool은 int하위. int a = 0 print("a =",a) print("a type =",type(a)) c = 9999999999999999999999999999999999 print("c =",c) print("c type =",type(c)...

Variable & Data Type

Variable 변수. 값을 저장하는 공간. 다른 언어에 비해 역시 편하다. c int a = 10; char * str = "test"; //이건 배열로 쓰는등 아무튼. c# int a = 10; string str = "c#"; ...