码迷,mamicode.com
首页 >  
搜索关键字:python 练习题    ( 137634个结果
计数器控制的for循环(C++/python版)
常见的编程错误:在while语句或for语句的条件中,如果使用了不正确的关系运算符,或者使用了不正确的循环计数器终值,会导致相差1的错误如果for语句控制变量的声明是放在其头部的初始化部分,在该语句循环体之后再使用此控制变量是一个编译错误在for的头部,使用逗号而不是两个分号将导致一个语法错误将一个...
分类:编程语言   时间:2014-06-08 23:08:55    阅读次数:338
Python/C++ in Visual Studio: An Alternative to Matlab/MEX
来自Andrew Delong的博客http://andrewdelong.wordpress.com/2012/11/03/pythonc-in-visual-studio-an-alternative-to-matlabmex/I spent much of my PhD working in ...
分类:编程语言   时间:2014-06-08 22:45:10    阅读次数:458
白手起家搭建django app
$django-admin.py startproject web2$cd web2/$python manage.py startapp blog$vim web2/settings.py 注意settings.py以下两个部分,首先要配置数据库,其次要在INSTALLED_APP里添加刚才新建的...
分类:移动开发   时间:2014-06-08 22:18:14    阅读次数:377
[leetcode]Sqrt(x) @ Python
原题地址:https://oj.leetcode.com/problems/sqrtx/题意:Implementint sqrt(int x).Compute and return the square root ofx.解题思路:实现开平方函数。这里要注意的一点是返回的时一个整数。通过这一点我们可...
分类:编程语言   时间:2014-06-08 21:04:38    阅读次数:329
[leetcode]Search for a Range @ Python
原题地址:https://oj.leetcode.com/problems/search-for-a-range/题意:Given a sorted array of integers, find the starting and ending position of a given target ...
分类:编程语言   时间:2014-06-08 21:03:21    阅读次数:297
[leetcode]Sort Colors @ Python
原题地址:https://oj.leetcode.com/problems/sort-colors/题意:Given an array withnobjects colored red, white or blue, sort them so that objects of the same col...
分类:编程语言   时间:2014-06-08 20:56:32    阅读次数:394
[leetcode]Add Binary @ Python
原题地址:https://oj.leetcode.com/problems/add-binary/题意:Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"...
分类:编程语言   时间:2014-06-08 20:28:04    阅读次数:300
更改python字符编码以便使用UTF-8的编码url路径
url编码分两种, 一种是unicode, 另一种是gb2312, 今天遇到的一个网站是要将字符编码按照gb2312来编码,用来得到一个先填写blanks后再返回页面的数据,废话少说,需要做的就是先查看你的python的编码是啥,默认是ascii,import sysprint sys.getd.....
分类:编程语言   时间:2014-06-08 20:17:26    阅读次数:342
【C语言】练习1-23
题目来源:《The C programming language》中的习题练习1-23:写一个删除C语言程序中所有的注释语句。要正确处理带引号的字符串与字符常量。在C语言中,注释不允许嵌套 思路: 注释语句分为两种://和/* */。在代码中,我们需要做的是,删除所有的注释语句。以下分两种情况来.....
分类:编程语言   时间:2014-06-08 20:10:43    阅读次数:314
使用python进行re拆分网页内容
这里简短的总结一下而不是完全的罗列python的re模块,python的re具有强大的功能,如下是一个从我们学校抓取数据然后拆分的程序,代码如下:import httplibimport urllibimport reimport sysreload(sys)sys.setdefaultencodi...
分类:编程语言   时间:2014-06-08 19:33:35    阅读次数:333
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!