Return

    8일차)프로그래밍 핵심 개념 in Python(return, optional parameter)

    8일차)프로그래밍 핵심 개념 in Python(return, optional parameter)

    1. 변수 제대로 이해하기 1) = 는 왼쪽과 오른쪽이 같다는 의미가 아니다.2) Python에서 = 는 지정연산자(assignment operator)3) 오늘쪽에 있는 값을 왼쪽 변수에 넣으라는 뜻 x = 7 x = x + 2 print(x) # 9 x = 7 x = x - 2 print(x) # 5 2. 함수의 실행 순서 def hello(): print("Hello!") print("Welcome to Codeit!") print("함수 호출 전")hello()print("함수 호출 후")# 함수 호출 전# Hello!# Welcome to Codeit! # 함수 호출 후 def square(x): #제곱근(sqrt) return x * x print("함수 호출 전")print(square(3)..