循环给值
总冠军科比
平平无奇的小学员 每天都在努力学习当中
展开
-
Python 函数
'''Map,Filter和Reduce三个函数能为Python函数式编程提供我们会通过实例来分别讨论并理解他们1.map()函数map()函数接受一个函数f和一个序列sq,这是它的规范map(函数,序列)'''items = [1,2,3,4,5,6]squared = [] #将平方后的数字存进去for i in items: squared.append(i**2)#向squared列表中添加元素,每次循环添加到最后print(squared)..原创 2021-11-11 16:57:13 · 341 阅读 · 0 评论 -
Python 数值的计算
#绝对值的计算:absprint(abs(-7))print(abs(7))#进制之间的转换:bin(),oct(),ord()#print(bin(100))#print(oct(100))#print(ord(100))#Ascll码表与字符之间的转换print(chr(37))print(ord('@'))#商和余数的计算:divmod()#print(divmod(10,3)) 10//3 10%3#幂计算:powprint(pow(2,5).原创 2021-11-11 16:52:01 · 885 阅读 · 0 评论 -
2021-05-05
package second.feuGe;//客户类public class Customer extends Person{ private String CustomerId;//客户ID private String phone;//手机号 //无参构造器方法 public Customer() { } //有参构造器方法 public Customer(String CustomerId,String phone)...原创 2021-05-05 12:50:09 · 41 阅读 · 0 评论