摘要:
一.概述 高阶函数,就是一个函数可以接收另一个函数作为参数的函数,scala与之类似。 二.导入基础包 import random from functools import reduce 三.自定义高阶函数 #定义普通函数,自动生成列表 def getList(): hList = list(ra 阅读全文
posted @ 2018-06-05 17:38
云山之巅
阅读(706)
评论(7)
推荐(0)
摘要:
一.isinstance&type isinstance()函数用来判断一个对象是否是一个已知类型的数据,类似于type()。 isinstance()和type()的区别: 1.type()不会认为子类是一种父类类型,不考虑继承关系。 2.isinstance()会认为子类是一种父类类型,考虑继承 阅读全文
posted @ 2018-06-05 16:39
云山之巅
阅读(386)
评论(0)
推荐(0)
摘要:
import math #测试循环numbers = ["one","two","three"] #定义列表for number in numbers:#遍历,测试for循环 print("number is : " + number)#使用for循环和基本列表创建新列表values = list( 阅读全文
posted @ 2018-06-05 15:49
云山之巅
阅读(168)
评论(0)
推荐(0)
摘要:
#"""学习和测试条件控制(单独使用和嵌套使用)"""#在prompt和jupyter中多行注释都无效#测试单独使用name = input("place input you name : ")#默认传入的是stringmid = input("place input you age : ")if 阅读全文
posted @ 2018-06-05 14:34
云山之巅
阅读(332)
评论(0)
推荐(0)

浙公网安备 33010602011771号