码迷,mamicode.com
首页 >  
搜索关键字:print    ( 43532个结果
【2】快速入门学习python整体
注意一下>>>主提示符... 次提示符python主要通过两种方式来解决问题:语句和表达式(函数,算术表达式);abs()函数,输出绝对值函数。绝对值的英文是Absolute value,取前面的abs,好记点。abs(-4)4abs(4)4当然我们现在需要的是先学习print语句。注意一下 py....
分类:编程语言   时间:2015-05-09 16:18:37    阅读次数:164
Python传参数最简单易懂的描述
关于,python的传参,很多人会搞得一头雾水,我也跟朋友讨论多次,最终通过实验,得到结论。一、所有传递都是引用传递二、在函数内使用[变量名]=,相当于定义啦一个局部变量OK,一段简单的代码描述这个特性: 1 def change(s): 2 print id(s) 3 s=1...
分类:编程语言   时间:2015-05-09 16:14:15    阅读次数:156
c++转python知识小记之一
# -*- coding: utf-8 -*-  #utf-8支持中文编码   words=['cat','dog','chicken'] for w in words[:]:  #words[:]复制了原本的list     words.insert(0, w) print words   a = range(0,10,4) print a args=[3,10,3] pr...
分类:编程语言   时间:2015-05-09 15:06:19    阅读次数:141
三元运算和lambda表达式
三元运算: result = 'get' if 1 > 3 else 'li' print result如果 if 条件中满足,就返回‘get’ 给result,如果为假就返回‘li'给resulttemp = lambda x,y : x + yprint temp(2,4)
分类:其他好文   时间:2015-05-09 13:12:07    阅读次数:137
Python HeapSort
__author__ = 'student' print 'hello world hello python' ''' heap sort root leftchild 2n+1 rightchild 2n+2 compare them and get the maxnode step by ste...
分类:编程语言   时间:2015-05-09 13:00:33    阅读次数:185
poj 2799 IP Networks 模拟
题意: 给一些ip,求包括他们的最小网络(网络号+子网掩码)。 分析: 关键是找到从高位到低位从哪位开始不同。 代码: //poj 2799 //sep9 #include using namespace std; typedef long long ll; ll vis[40]; void print(ll x) { ll a,b,c,d; d=x%(1<<8); x=x/(...
分类:Web程序   时间:2015-05-09 08:54:11    阅读次数:194
python read 二进制文件
具体要参考struct的包的书名书#encoding:gbk import struct import binasciivalues=(65533,'sh',75533,99985544)#要二进制的数据 s=struct.Struct('I 2s I I') #格式化 packed_data=s.pack(*values)#转为二进制print "original values:", values...
分类:编程语言   时间:2015-05-09 08:52:22    阅读次数:119
php获取 本月 本周 或者 下月 下周的 开始时间 结束时间
';print_r($day1);//今天print_r($day2);//昨天print_r($week1);//这周print_r($week2);//上周print_r($month1);//这月print_r($month2);//上月echo '';
分类:Web程序   时间:2015-05-09 08:48:54    阅读次数:129
PHP CURL实现远程下载文件到本地
';print_r($result);function httpcopy($url,$file='',$timeout=60){ $file=empty($file)?pathinfo($url,PATHINFO_BASENAME):$file; $dir=pathinfo($file,...
分类:Web程序   时间:2015-05-09 07:42:24    阅读次数:170
python 输出字典的key
给你一字典a,如a={1:1,2:2,3:3},输出字典a的key,以‘,‘链接,如‘1,2,3‘。 b=a.keys() m=[] for?i?in?b: ????m.append(str(i)) print?‘,‘.join(m)...
分类:编程语言   时间:2015-05-08 23:59:37    阅读次数:635
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!