自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 收藏
  • 关注

原创 Analyzing the character of human being

I wanted to analyze a team member when I was a team leader in Shenzhen IBM before. The question is how can I analyze a person using a suitable tool. I came up with the radar map, and I think it is a g...

2019-09-14 11:15:44 196

原创 Lecture 11: Testing and debugging

# Lecture 11 fall 2008 def silly(): res = [] done = False while not done: while not done: elem = input('Enter element. Return when done. ') if elem == '':

2017-09-25 00:36:42 255

原创 Lecture 10: Divide and conquer methods, merge sort, exceptions

# Lecture 10 fall 2008 def merge(left,right): result = [] i,j = 0, 0 while i < len(left) and j < len(right): if left[i] <= right[j]: result.append(left[i])

2017-09-25 00:35:17 268

原创 Lecture 9: Binary search, bubble and selection sorts

# Lecture 9 fall 2008 def bsearch(s, e, first, last, calls): print (first, last, calls) if (last - first) < 2: return s[first] == e or s[last] == e mid = first + (last - first)//2

2017-09-25 00:25:31 192

原创 Lecture 8: Complexity; log, linear, quadratic, exponential algorithms

# code file for lecture 8, 2008 fall #interative exponent def exp1(a,b): ans = 1# Initiation ans(two more step) while (b>0):#Step1: comparsion ans *= a#Step2: multiplication

2017-09-25 00:24:07 265

原创 Lecture 7_2: Lists and mutability, dictionaries, pseudocode, introduction to efficiency

# example code, Lecture 7, Fall 2008 import math #get base inputOK = False while not inputOK: base = float(input('Enter base:')) #we get str in python 3x from input, we need to convert str t

2017-09-25 00:21:14 199

原创 Lecture 7_1: Lists and mutability, dictionaries, pseudocode, introduction to efficiency

# example code, Lecture 7, Fall 2008 def showDicts(): EtoF = {'one': 'un', 'soccer': 'football', 'never': 'janaie'} print (EtoF['soccer']) input() # print (EtoF[0]) #Dictionary is

2017-09-25 00:17:34 173

原创 Lecture 6: Bisection methods, Newton/Raphson, introduction to lists

# example code, Lecture 6, Fall 2008 s = 0 for i in range(10): s += 0.1 print (s) def squareRootBi(x,epsilon): '''Assumes x >= 0 and epsilon > 0 return y s.t. y*y is within epsilon of

2017-09-25 00:16:14 232

原创 Lecture 4: Decomposition and abstraction through functions; introduction to recursion

# example code, Lecture 4, Fall 2008 def sqrt(x): ans = 0 if x >= 0: while ans*ans < x: ans = ans + 1 if ans*ans != x: print (x, 'if not a prefect square')

2017-09-25 00:14:37 286

原创 Lecture 3: Common code patterns: iterative programs

# example code, Lecture 3, Fall 2008 x =16 ans = 0 while ans*ans < x: ans = ans + 1 print (ans) x = 1515361 ans = 0 if x >= 0: while ans*ans < x: ans = ans + 1 print ('ans ='

2017-09-25 00:12:35 181

原创 Lecture 2: Operators and operands; statements; branching, conditionals, and iteration

# sample code for use in Lecture 2, Fall 2008 x = 3 x=x*x n = input('Enter a number:') print (n) x = 15 if (x/2)*2 == x: print ('even') else: print ('odd') z = 'b' if 'x'<z: print ('Hello')

2017-09-25 00:06:04 213

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除