본문 바로가기

MIT5

5. 실수형 (Floating point numbers) 강의링크: https://youtu.be/Pfo7r6bjSqI?si=Xb_yQlLEwwPqsVdj - python의 두 종류 수 int(integer) Arbitrary precision integers(원하는만큼 큰 수를 만들 수 있음) - 파이썬에만 있는 것 ex) >>> a = 2 ** 1000 를 입력하고 a를 출력하면 긴 숫자 끝에 L이 붙어서 나옴(Long) 이는 내부에 긴 형식의 특정한 정수임을 의미함(particular integer in what it calls it's internal long format) >>> b = 2 ** 999 를 입력하고 a/b를 하면 2가 아닌 2L를 돌려줌(한 번 L을 얻으면 L의 형태를 유지하기 때문) Float(floating point): 프로그래밍.. 2020. 3. 25.
4. 분해와 추상 함수(Decomposition and abstraction through functions) 강의링크: https://youtu.be/SXR9CDof7qw?si=iD7TskyctqpU8CL3 - 지금까지 배운 것(python) assignment, conditionals, I/O, looping constructs(for, while), data => turing complete 이러한 것만으로는 코드를 쓸 때 우리가 옳은 곳에 있는지 확인하기 위해 어떤 것이 어디에 있는지, 어디서 가는지 모두 알아내기는 어려움 그래서 여기에 추가할 수 있는 것(오늘 배울 것) 1) decomposition(분해): 코드에 구조를 두는 방법(코드를 모듈로 나누는 방법. 코드는 프로세스의 성분들을 분리함) 2) abstractions(추상화): 자세한 내용을 숨기게 함 - Functions 함수가 위의 2가지를 .. 2020. 3. 22.
3. 일반적인 코드 패턴(Common code patterns) 강의링크: https://youtu.be/X6ilT3uUOBo?si=o_2dJADTGIIE0o_Z - 지난 시간까지 배운 것 코드를 쓸 때 필요한 기본적 요소들 Data: 우리가 예상하는 것, 이동하길 원하는 정보를 나타내는 방법(number, strings, Booleans) Operations: +, * / and, or Commands(or statements): assignment, input/output, conditionals(명령문의 순서를 통해 제어의 흐름을 바꾸는 branch), loop mechanisms(while) for Good programming style: 1) comment 쓰기(디버그를 쉽게 하기 위해) 2) Type checking(연산자 적용 전에 피연산자의 type을.. 2020. 3. 22.
2. 연산자와 피연산자(Operators and operands) 강의링크: https://youtu.be/Pij6J0HsYFA?si=7RXdk2u3jTqb3Nnp 프로그램을 사용하기 위해서는 1) primitive data(numbers, strings, boolean, value & type, etc.)를 표현하고 2) data 조작을 위해 컴퓨터에 명령을 내리는 방법 위의 2가지를 알아야 한다. 우리는 value & type을 명령문(연산자, 피연산자)으로 조합할 수 있다.(combine in expression) 인터프리터는 평가(evaluates)와 출력(prints)을 하는데, 명확하게 나타내지 않으면(explicit) 출력하지 않는다. (즉, 인터프리터에서 'print'를 입력해야 출력함) >>> str(3) + 'ab' '3ab' 여기서 type이 전환(.. 2020. 3. 19.
1. 강의 소개 및 목표 강의 링크: https://youtu.be/k6U-i4gXkLM?si=fbTFLFnI13Jbd7zH Skills: Computational thinking Understand code Understand abilities & limit problems -> computational thinking으로 연결 "Think like a computer scientist." Knowledge - 서술적 지식, 명령적 지식 Fixed program computer: Calculator, Atanasoff의 ?, Turing의 Bombe, etc. Stored program computer Memory Develop programming style Python values(변수, 초기 데이터 요소) numbers(.. 2020. 3. 18.