
























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A step-by-step guide to creating a simple calculator and a turtle graphics program in python. It covers topics such as variables, data types, basic operations, input/output, and functions. The calculator program includes basic arithmetic operations, while the turtle graphics program allows users to draw shapes and lines using the mouse.
Typology: Summaries
1 / 32
This page cannot be seen from the preview
Don't miss anything!

























a=100은 a ← 100과 같은 개념 내부적으로는 a 와 b 그릇이 생겨 a 그릇에는 100 이, b 그릇에는 50 이 담긴 상태 → 프로그래밍 언어에서 그릇과 같은 역할을 하는 것이 바로 변수
a 그릇의 100 과 b 그릇의 50 을 합쳐 새로운 result 그릇에 들어간 상태가 됨 변수는 result에 값이 들어가더라도 a, b의 변수값이 그대로 남음
CookPython 폴더를 만들어 사용
코드가 수십 줄인 경우는 스크립트 모드 사용(IDLE에서 [File]-[New File] 메뉴 선택) 메모장 같은 창인 스크립트 모드에서 코드를 여러 줄 입력 가능. 단, 실행은 되지 않음
스크립트 모드에서 [Run]-[Run Module] 메뉴 선택(또는 [F5]) 파이썬 코드를 파일 탐색기에서 바로 실행하는 방법은 교재 41 쪽의 [여기서 잠깐] 참고
IDLE에서 [File]-[Open] 메뉴를 선택한 후 Code02-01.py 열기
대화형 모드에서 [File]-[New File] 메뉴를 선택해 새 파일을 연 후 스크립트 모드에서 [File]- [Save] 메뉴를 선택해 C:\CookPython\Code02-02.py로 저장
오른쪽 예처럼 int() 함수를 사용해 정수로 변환 Code02-02.py의 1~2행을 다음과 같이 수정 후 다시 [F5]를 눌러 실행