- 博客(4)
- 收藏
- 关注
原创 MIT6001x_Review_Lec3_Loops, Strings, Guess-and-Check, Approximation, Bisection
stringsa sequence of case-sensitive characterscan compare: ==. <, >, <=, >=>>> 'a' < 'b'True## alphabetic order len()aStr[ ] indexing and slicingimmutableQuesiont: Finding the cube root(三次方根)of a number.Approximate
2020-07-18 12:10:58 183
转载 编程入门指南 v1.5
https://zhuanlan.zhihu.com/p/19959253这篇文章是写给那些真心想学编程的人看的——那些憋着一股狠劲儿,一定要做出个什么真东西,不学好不罢休的人;而不是那些「听说编程好玩」的人,在我看来,这种人永远都入不了编程的门,更别提做出个像样的东西来了。心态调整确定目标在你学习编程之前思考一下你的目标,当你有最终目标时道路会更加的清晰。那么,你想要写什么?网站?游戏? iOS 或者 Android 应用?或是你是想自动化完成一些乏味的任务让你有更多的时间看窗外的风景?也许你只是
2020-07-16 16:12:10 173
原创 return +判断列表A包含列表B的所有元素
Returndef fun1(): return x = 1SyntaxError: invalid syntaxdef fun1(): x = 1 return x Decide whether all the elements of List A are in List BlistA = [1, 2, 3]listB = [1, 2, 3, 4]listB contains listAlistA = [1, 2, 3]listB = [1, 2, 3, 4]
2020-07-16 12:06:38 451
原创 复制词典与列表
when copying a dict:aDict.copy()if you try to use aDict[:]TypeError: unhashable type: ‘slice’Python definition of Hashable is: An object is hashable if it has a hash value which never changes during its lifetime (it needs a hash() method).A list is
2020-07-16 11:49:42 159
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人