파라미터
-
Python Chapter08방뚝딱 학습노트 2023. 10. 29. 19:08
교재 : 멘토씨리즈 파이썬 디폴트 파라미터 입력 파라미터를 따로 주지 않는 경우에도 함수를 호출할 수 있게 합니다. 일반적으로 어떤 한개의 파라미터가 값을 가지게 되면 다른 파라미터가 디폴트 파라미터로 사용하곤 합니다. 메서드 메서드는 특정 객체가 가지고 있는 함수를 의미합니다. 특정 자료형에 포함되어 있는 함수라고 볼 수 있습니다. 독자적으로 쓰는 함수 : print(), round(), input() 함수와 메서드는 같은 개념이지만 차이가 있다면 함수는 독립적으로 호출 할 수 있으면 메서드는 특정 객체를 통해서만 호출할 수 있습니다. 포함되어 있어 독자적으로 쓰지 못하는 함수 : .함수 num1,num2 = input().split() String 인덱싱, 슬라이싱이 가능하다 값을 수정할 수 있다. ..
-
Python Chapter07방뚝딱 학습노트 2023. 10. 18. 22:05
교재 : 멘토씨리즈 파이썬함수프로그램밍에서 함수는 반복적인 코드를 작성할 때 이를 짧고 간편하게 사용하기 위해 함수를 만듭니다. 프로그래밍에서의 함수와 수학에서의 함수는 차이가 있습니다.수학에서의 함수 : input과 output이 존재f(x) = x + 2;프로그래밍에서 함수 : input과 output이 없을 수도 있다.프로그래밍 언어에서 함수는 두 가지 유형으로 구분 할 수 있습니다.사전에 정의된 함수(이미만들어진 함 사용자 정의 함수사전에 정의된 함수는 지금까지 사용했던 내장함수가 그 예시입니다. print(), input(), append(), insert(), type()…내장함수-146p배우지 않은 함수들 중에서 유용한 내장 함수가 많이 존재합니다.abs(x) : x의 값의 절대값을 반환3 ..