会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Eternal_kong
博客园
首页
新随笔
联系
订阅
管理
1
2
下一页
2019年1月16日
Python.*args and **kw
摘要: *args将传入对象当成是元组对待;**kw将传入对象当成字典对待。**kw的作用是在函数调用时,可变参数的key,value值打包成dic,传给kw。因此是kw.iterable()。
阅读全文
posted @ 2019-01-16 13:24 skylight9
阅读(74)
评论(0)
推荐(0)
2019年1月15日
Python.sort
摘要: sort 与 sorted 区别: sort 是应用在 list 上的方法,sorted 可以对所有可迭代的对象进行排序操作。 list 的 sort 方法返回的是对已经存在的列表进行操作,无返回值,而内建函数 sorted 方法返回的是一个新的 list,而不是在原来的基础上进行的操作。 sort
阅读全文
posted @ 2019-01-15 12:58 skylight9
阅读(180)
评论(0)
推荐(0)
Python.rough
摘要: python中编写带参数decorator
阅读全文
posted @ 2019-01-15 12:54 skylight9
阅读(150)
评论(0)
推荐(0)
2019年1月14日
Python
摘要: map()是 Python 内置的高阶函数,它接收一个函数 f 和一个 list,并通过把函数 f 依次作用在 list 的每个元素上,得到一个新的 list 并返回。 reduce()函数也是Python内置的一个高阶函数。reduce()函数接收的参数和 map()类似,一个函数 f,一个lis
阅读全文
posted @ 2019-01-14 15:12 skylight9
阅读(72)
评论(0)
推荐(0)
2018年2月7日
C++谭浩强 课后习题 第四章函数预处理 14
摘要: #include<iostream>using namespace std;int main(){ char i; while(1) { cin>>i; if ((i>=65)&&(i<=90)) { i=i+32; cout << i; } else if((i>=97)&&(i<=122)) {
阅读全文
posted @ 2018-02-07 14:44 skylight9
阅读(71)
评论(0)
推荐(0)
C++谭浩强 课后习题 第四章函数预处理 11
摘要: #include <iostream>using namespace std;int s(int);int main(){ int n; cin>>n; cout<<s(n)<<endl; system("pause"); return 0;}int s(int n){ int m=0; if(n=
阅读全文
posted @ 2018-02-07 10:28 skylight9
阅读(64)
评论(0)
推荐(0)
2018年2月6日
C++谭浩强 课后习题 第四章函数预处理 8
摘要: #include <iostream>using namespace std;double f(int,int);int main(){ int n,x; cout<<"please enter n,x"; cin>>n>>x; cout<<f(n,x)<<endl; system("pause")
阅读全文
posted @ 2018-02-06 15:35 skylight9
阅读(71)
评论(0)
推荐(0)
C++谭浩强 课后习题 第四章函数预处理 7
摘要: #include<iostream> using namespace std; int prime(int n){ int j,k; for(j=2;j<n;j++){ if(n%j==0){ k=0; return(k); break; }else{ k=1; return(k); } } } i
阅读全文
posted @ 2018-02-06 11:43 skylight9
阅读(91)
评论(0)
推荐(0)
2018年2月5日
C++谭浩强 课后习题 第四章函数预处理 5
摘要: #include<iostream>#include <iomanip>#include <cmath>using namespace std;double sin_h(double);double e_x(int);const double e=2.71828459;int main(){ int
阅读全文
posted @ 2018-02-05 15:00 skylight9
阅读(94)
评论(0)
推荐(0)
C++谭浩强 课后习题 第四章函数预处理 4
摘要: #include <iostream>using namespace std;int fac(int);int main(){ int a,b,c; cout<<"please enter a,b,c"; cin>>a>>b>>c; cout<<"a!="<<fac(a)<<","<<"b!="<<
阅读全文
posted @ 2018-02-05 12:17 skylight9
阅读(77)
评论(0)
推荐(0)
1
2
下一页
公告