2017年10月12日
摘要: 近来看machine learning in action中对numpy稍有接触,其中对于array的shape有些疑惑,翻阅查询后稍有了解,分享以交流。 1、shape意思为‘形状’,在很多模块(pygame、matplotlib)都有这个函数,在numpy中用在array后顾名思义就是‘矩阵的形 阅读全文
posted @ 2017-10-12 09:49 auleon 阅读(679) 评论(0) 推荐(0) 编辑
  2017年8月28日
摘要: 输出结果为: apples oranges cherries banana Ali Bob Carol David dogs cats moose goose 要求结果为: 阅读全文
posted @ 2017-08-28 11:36 auleon 阅读(145) 评论(0) 推荐(0) 编辑
  2017年8月25日
摘要: #The addToInventory() function should return a dictionary that represents the updated inventory. 阅读全文
posted @ 2017-08-25 23:19 auleon 阅读(120) 评论(0) 推荐(0) 编辑
摘要: # Write a function named displayInventory() that would take any possible “inventory” and display it like the following: Inventory: 阅读全文
posted @ 2017-08-25 23:16 auleon 阅读(210) 评论(0) 推荐(0) 编辑
  2017年8月24日
摘要: def printTable(dic_name,l_length,r_length): print('ITEM TABLE'.center(l_length+r_length,"-")) for k,v in dic_name.items(): print(str(k).ljust(l_length,'.')+str(v).rjust(r_length,' '))... 阅读全文
posted @ 2017-08-24 13:18 auleon 阅读(118) 评论(0) 推荐(0) 编辑
  2017年8月23日
摘要: theBoard={'top-L':' ','top-M':' ','top-R':'', 'mid-L':' ','mid-M':' ','mid-R':'', 'low-L':' ','low-M':' ','low-R':''} def printBoard(board): print(board[ 阅读全文
posted @ 2017-08-23 17:15 auleon 阅读(216) 评论(0) 推荐(0) 编辑
  2017年8月17日
摘要: 1# range()method: range(a1,a2,b):from a1 to a2,including a1,not a2,with b as the interval; range(a): from 0 to a,successive integer,contains a numbers 阅读全文
posted @ 2017-08-17 23:27 auleon 阅读(133) 评论(0) 推荐(0) 编辑
  2017年8月10日
摘要: num2=0在while外和内得到截然不同的运行结果: 当num2=0在while外循环时,num2完成一次循环后值变为8,重新执行num1时,num2<=7不满足,所以不会执行; 当num2=0在while内循环时,num2完成一次循环后值变为8,重新执行num1时,num2被重新赋值。 阅读全文
posted @ 2017-08-10 16:39 auleon 阅读(1047) 评论(0) 推荐(0) 编辑
摘要: method1\ import module_name1,module_name2 way to use function in it: module_name1.function_name() method2\ from import module from module_name import 阅读全文
posted @ 2017-08-10 16:32 auleon 阅读(309) 评论(0) 推荐(0) 编辑
摘要: 1、range()能返回一系列连续增加的整数,可以生成一个列表对象。 大多出现在for循环中,在for循环中可以作为索引使用。 2、range(2) ——[0,1] range(1,3)——[1,2] range(1,7,2)——[1,3,5] range(6,-2,-2)——[6,4,2,0] 阅读全文
posted @ 2017-08-10 10:51 auleon 阅读(1023) 评论(0) 推荐(0) 编辑