본문 바로가기

오식랜드

검색하기
오식랜드
프로필사진 개발하는 오식이

  • all (163)
    • dev-log (158)
      • html·css·js (24)
      • vue·nuxt.js (16)
      • python (48)
      • java (15)
      • git (0)
      • react (0)
      • server (8)
      • cs (42)
    • daily-log (0)
Guestbook
반응형
Notice
Recent Posts
«   2025/08   »
일 월 화 수 목 금 토
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록python function (1)

오식랜드

[python] 함수

함수 선언 def 함수이름 () : def 함수이름(): 실행 명령문1 실행 명령문2 .... 함수 사용 def greeting(): print('hi') greeting() # 함수 호출 함수 반환과 파라미터 소괄호() 안에 파라미터 전달 가능 return 을 통해 값 반환도 가능 def greeting(text): return print(text) greeting('bye') # bye 출력 또한 파라미터에는 기본값을 넣어줄 수 있습니다 def greeting(text='hello'): return print(text) greeting() # hello 출력 가변인자 좋아하는 과일 이름을 파라미터로 놓고 출력하는 함수를 만들었다 def fruit(fruit1, fruit2, fruit3, fruit4..

dev-log/python 2023. 1. 9. 14:43
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바