파이썬 프로시저
-
49 - 프로그램, 루틴, 프로시저, 메서드, 함수study with Q - 파이썬 2024. 6. 2. 17:58
# 프로그램(program): 미리 작성한 것 코드 전체에서 - 프로그램(program), 루틴(routine)디른 의미로 변경 - 절차(procedure), 방법(method) 예시) 케이크를 먹는 프로그램 한 입 냠)print("400g의 케이크가 있다.")# 케이크를 먹는 프로그램, 루틴cake = { "name":"dankge", "left": 400}# 케이크를 먹는 서브프로그램, 서브루틴print("케이크를 80g 자른다")print("냠")cake["left"] -= 80print(f"남은 케이크의 무게는 {cake['left']}이다.")>>>400g의 케이크가 있다.케이크를 80g 자른다냠남은 케이크의 무게는 320g이다. #서브 프로그램, 서브 루틴 전용 문법, def print(..