MIT_OCW
7: Lists and Mutability, Dictionaries, Introduction to Efficiency import math #Get baseinputOK = Falsewhile not inputOK: base = input(‘Enter base: ‘) if type(base) == type(1.0) : inputOK = True else: print(‘Error. Base must be floating point number.’) #Get HeightinputOK = Falsewhile not inputOK: height = input(‘Enter height: ‘) if type(height) [...]
Continue reading about Lec 7 | MIT 6.00 Introduction to Computer Science and Programming, Fall 2008
6: Bisection Methods, Newton/Raphson, Introduction to Lists def squareRootBi(x, epsilon): “””Assumes x >= 0 and epsilon > 0 Return y s.t. y * y is within epsilon of x””” assert x >= 0, ‘x must be non-negative, not’ + str(x) assert epsilon > 0, ‘epsilon must be positive, not’ + str(epsilon) [...]
Continue reading about Lec 6 | MIT 6.00 Introduction to Computer Science and Programming, Fall 2008
5: Floating Point Numbers, Successive Refinement, Finding Roots def squareRootBi(x, epsilon): “””Return y s.t. y*y is within epsilon of x””” assert epsilon > 0, ‘epsilon must be positive, no ‘ + str(epsilon) low = 0 high = max(x, 1) guess = (low + high) / 2.0 ctr = 1 [...]
Continue reading about Lec 5 | MIT 6.00 Introduction to Computer Science and Programming, Fall 2008
첫 시간. 수업의 내용과 앞으로 어떤 공부들을 하게 될 것인지에 대한 설명을 하고 있다. 파이썬을 프로그래밍 언어로 사용할 것이며, 그외 기타 등등에 대한 이야기를 하고 있다. The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseware continue to offer high-quality educational resources for free. To make a donation, or [...]
Continue reading about Lec 1 | MIT 6.00 Introduction to Computer Science and Programming, Fall 2008


최근 답글