책소개
4차산업혁명에서는 컴퓨터 소프트웨어의 중요성이 더욱 커질 것으로 예상되며,
모든 업무에서 인공지능 기술이 가장 핵심적인 요소로 등극하게 될 것이다. 이에
따라 대학교는 물론 초중고등학교에서도 컴퓨터 프로그래밍 교육의 중요성이 커지
며, 교육과정에서 수업 시간도 점차 많아지고 있다. 현재 모든 사람들이 컴퓨터와
스마트폰을 사용하듯이 미래에는 모든 사람들이 프로그램을 작성하고, 이를 바탕으
로 업무를 수행할 것이다.
이 책은 기존 파이썬 프로그래밍 책과는 다르게 중학교 수준 정도의 기초 수학을
알면 프로그램을 작성할 수 있도록 구성하였다. 다른 책들이 언어의 문법을 주로
설명하였다면, 이 책에서는 순차, 조건, 반복, 함수 등의 개념을 쉽게 이해할 수 있
고, 응용할 수 있도록 구성하였다. 이 책의 접근 방법은 고등학생 및 대학 신입생
교양 수업 등에서 이공계는 물론 인문사회 분야 학생들에게 적용해보았으며, 학생들
의 만족도가 기존 다른 책들에 비해 매우 높았다.
이 책을 통해서 독자들이 프로그래밍에 대한 이해와 파이썬 언어의 기초를 배울
수 있기를 희망한다.
목차
목 차
1. 컴퓨터와 미래 사회 ······································································································ 1
1.1 컴퓨터 활용 능력의 필요성 ·························································································· 1
1.2 미래 사회와 컴퓨터 ····································································································· 9
1.3 개인정보 보호와 윤리 ······························································································· 14
2. 컴퓨터와 소프트웨어 이해 ······················································································· 19
2.1 컴퓨터의 역사 ·············································································································· 19
2.2 컴퓨터의 기본적인 이해 ························································································· 26
2.3 소프트웨어의 이해 ··································································································· 34
2.4 프로그램 작성을 위한 기본 개념 ············································································ 37
3. 파이썬 프로그래밍 소개 ·························································································· 41
3.1 파이썬 언어 소개 ······································································································· 41
3.2 프로그램의 역할과 기본 구조 ·················································································· 45
3.3 컴퓨터에 파이썬 설치하기 ······················································································ 48
3.4 숫자 계산하기 ············································································································ 52
3.5 변수 사용 ······················································································································ 62
4. 공식 변환 방법과 데이터 처리 방법 ····································································· 67
4.1 공식 변환을 활용한 문제 해결 ·············································································· 67
4.2 키보드 입력 ················································································································ 76
4.3 문자열 ·························································································································· 80
4.4 리스트 ·························································································································· 87
4.5 기타 ····························································································································· 89
5. 조건에 따른 문제 해결 ···························································································· 93
5.1 참, 거짓과 연산자 ······································································································· 93
5.2 조건을 만족하는 경우에 실행 ·················································································· 98
5.3 조건을 여러 번 물어봐야 하는 경우 ···································································· 108
5.4 조건문 응용: 최소/최대 구하기 ············································································ 112
6. 반복적 문제 해결 ··································································································· 115
6.1 반복문 이해 ·············································································································· 115
6.2 반복문 응용 1 : 반복적인 출력 ············································································ 118
6.3 반복문 응용 2 : 숫자의 합 ··················································································· 122
6.4 반복문 응용 3 : 리스트 내용 접근 ···································································· 124
6.5 반복문 응용 4 : 최소/최대값 구하기 ·································································· 126
6.6 반복문 응용 5 : 반복적인 작업 ············································································ 128
6.7 while을 이용한 반복문 ···························································································· 129
7. 함수 정의와 활용 ··································································································· 135
7.1 함수 개념 ················································································································· 135
7.2 함수 작성 응용 ········································································································ 141
7.3 넘겨줄 결괏값이 없거나 많은 경우 ······································································ 147
7.4 재귀적 함수 ·········································································································· 150
7.5 기존 함수 활용 ·································································································· 152
8. 클래스 추상화 ········································································································· 159
8.1 클래스 개념 ·············································································································· 159
8.2 파이썬 클래스 작성 ································································································· 160
8.3 큰 개념과 작은 개념 (상속) ··············································································· 164
8.4 기존 클래스 활용하기 ························································································· 167
9. 파이썬 라이브러리 활용 ······················································································ 173
9.1 라이브러리 사용하기 ······························································································· 173
9.2 파일 관련 기능 사용하기 ····················································································· 177
9.3 그림 파일 관련 기능 사용하기 ·········································································· 179
9.4 음성 관련 기능 사용하기 ····················································································· 183
9.5 텍스트 파일 입출력 ······························································································· 185
10. GUI 프로그래밍 작성해보기 ·············································································· 193
10.1 Tkinter 사용해보기 ······························································································ 193
10.2 Qt 디자이너를 이용한 Qt 프로그래밍 ······························································ 195
10.3 Qt의 위짓 알아보기 ····························································································· 204
10.4 이벤트 프로그래밍 ································································································ 207
10.5 웹 브라우저 만들기 ································································································ 214
11. 데이터베이스 사용하기 ························································································ 219
11.1 데이터베이스 개념 ································································································ 219
11.2 데이터베이스 환경 설정 ······················································································· 219
11.3 SQL 이해하기 ········································································································ 228
11.3 파이썬에서 데이터베이스 접근하기 ·································································· 233
부록 A. 파이썬 연산자 ······························································································· 241