Computer Engineering/Python
-
파이썬 함수 호출하기Computer Engineering/Python 2023. 3. 7. 11:58
파이썬 함수 호출하기 수학적 정의 f(x) = x + 2 => f(2) => 4 정의 / 호출 구조 함수는 정의하고 호출하는 방식 정의 하는 방법 def def 함수명 (인자1, 인자2, ...): #argument or parameter 구문1 구문2 구문3 ... return 아웃풋 # output이 있는 경우 ! def f(wow_x) : result = wow_w + 2 return result def wow_f(wow_x, wow_y): return wow_x - wow_y 함수 정의 할 때 바깥 문단에서는 접근할 수 없음 호출 하는 방법 def f(wow_x): result = wow_x + 2 return result f(2) = 4 wow_f_result = wow_f(2, 3) wow_f..
-
파이썬 변수 / 자료형Computer Engineering/Python 2023. 3. 7. 10:34
변수를 담아놓는 주머니, '자료형' https://aquaorinfosec.tistory.com/17 CPU : 연산장치, Disk : 저장공간, RAM : context 처리공간 - 변수 할당하기 a = 1 - 자료형 변수 - 숫자( Integer 정수형, float ) : a =1, b = 2,3, c - -5 - ### C언어의 경우 : int(a) = 1, float(b) = 2,3 - list 자료형 : a = [ ], [ ]를 이용하는것이 list - indexing : - 0부터 시작한다., -1 indexing : 맨 뒤, -2 indexing : 뒤에서 2번째 - "범위" indexing : class_score[0:1] 0이상 1미만 다차원 list : [ ] - [[1,2], [1.2..
-
Python 개발환경 세팅Computer Engineering/Python 2023. 3. 7. 10:30
Anaconda Anaconda CMD Prompt : 마우스, 키보드가 없던 시절 명령어로 활용 C:\Users\user>dir 존재하고 있는 파일들을 보여준다. C:\Users\user>cd cd : change directory 특정 공간으로 이동하는 명령어, cd .. : 전에 폴더로 이동 mkdir : make directory, start . : file open C:\Users\user>python : 파이썬 실행 Jupyter Notebook / Jupyter Lab : 기능은 같다. C:\Users\user>Jupyter-Lab 실행 시 쥬피터 켜지면서 CMD 는 심장 역할만 Jupyter 둘러보기 - Markdown Markdown : Code가 아닌 텍스트 작성, https://gis..