码迷,mamicode.com
首页 >  
搜索关键字:beginning    ( 817个结果
Beginning Python From Novice to Professional (3) - 列表操作
列表操作list函数:[python] view plaincopy>>>list('hello')['h','e','l','l','o']改变列表:[python] view plaincopy>>>x=[1,1,1]>>>x[1]=2>>>x[1,2,1]删除元素:[python] view ...
分类:编程语言   时间:2014-11-13 00:27:27    阅读次数:264
Beginning Python From Novice to Professional (2) - 命令行运行Python脚本
命令行运行Python脚本Linux下先创建一个hello.py[python] view plaincopy$gedithello.py输入:[python] view plaincopy#!/usr/bin/envpythonprint2+2保存退出,运行:[python] view plain...
分类:编程语言   时间:2014-11-13 00:17:32    阅读次数:263
LeetCode——Count and Say
The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11. 11 is read off as "two 1s" or 21. 21 is read off as ...
分类:其他好文   时间:2014-11-12 19:50:50    阅读次数:164
Beginning Python From Novice to Professional (5) - 条件与循环
条件与循环 条件执行: name = raw_input('What is your name? ') if name.endswith('Gumby'): print 'Hello, Mr.Gumby'What is your name? Gumby Hello, Mr.Gumbyname = raw_input('What is your name? ') if name.endswit...
分类:编程语言   时间:2014-11-12 19:50:03    阅读次数:245
Beginning Python From Novice to Professional (4) - 字符串格式示例
$ gedit price.py #!/usr/bin/env python width = input('Please enter width: ') price_width = 10 item_width = width - price_width header_format = '%-*s%*s' format = '%-*s%*.2f' print '=' * width...
分类:编程语言   时间:2014-11-12 16:33:21    阅读次数:248
Beginning Python From Novice to Professional (3) - 列表操作
列表操作 list函数: >>> list('hello') ['h', 'e', 'l', 'l', 'o']改变列表: >>> x=[1,1,1] >>> x[1]=2 >>> x [1, 2, 1]删除元素: >>> names = ['wu','li','zhao','qian'] >>> del names[1] >>> names ['wu', 'zhao', 'qian']分...
分类:编程语言   时间:2014-11-12 15:06:10    阅读次数:142
Beginning Python From Novice to Professional (1) - 数字和表达式
数字和表达式 加减乘除: >>> 2+2 4 >>> 100-50 50 >>> 3*5 15 >>> 1/2 0 >>> 1.0/2.0 0.5求余、乘方: >>> 1%2 1 >>> 10%3 1 >>> 2**3 8 >>> -3**2 -9 >>> (-3)**2 9十六进制、八进制: >>> 0xff 255 >>> 020 16变量: >>> x=3 >>> x*2 6获取输...
分类:编程语言   时间:2014-11-12 13:53:31    阅读次数:211
Beginning Python From Novice to Professional (2) - 命令行运行Python脚本
命令行运行Python脚本 Linux下先创建一个hello.py $ gedit hello.py 输入: #!/usr/bin/env python print 2+2保存退出,运行: $ python hello.py 4我们也可以让它变得和普通程序一样执行 执行之前,让脚本文件具备可执行属性: $ chmod a+x hello.py运行脚本: $ ./hello.py ...
分类:编程语言   时间:2014-11-12 13:47:51    阅读次数:180
第一轮 M
Milliard Vasya's Function Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Description Vasya is the beginning mathematician. He decided to make an impor...
分类:其他好文   时间:2014-11-11 09:26:25    阅读次数:272
Count and Say 计数和读法
The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read off as"tw...
分类:其他好文   时间:2014-11-10 06:30:28    阅读次数:178
817条   上一页 1 ... 62 63 64 65 66 ... 82 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!