- 博客(6)
- 收藏
- 关注
原创 不确定的问题 2015-8-12
# 5-12 系统限制。写一段脚本确认一下python所能处理的整形,长整形,浮点数和复数的范围。def pythonLimit(): import sys print (sys.maxint) print (-sys.maxint-1) print (sys.float_info) print (sys.long_info)网上找的,
2015-08-12 22:39:14
421
原创 Python核心编程(第二版) 第五章 课后习题(1)
# 5-2 乘积def multi(num1, num2): return num1 * num2# 5-3 评测成绩def grades(): score = int(raw_input('Please enter your scores: ')) if 90 return 'A' elif 80
2015-08-12 22:18:23
1141
原创 Python HAIL CAESAR (凯撒密码) 3
# 6.00x Problem Set 6## Part 1 - HAIL CAESAR!import stringimport randomWORDLIST_FILENAME = "E:/python/2015-6-10/words.txt"# -----------------------------------# Helper code
2015-06-16 23:05:33
1104
原创 Python HAIL CAESAR (凯撒密码) 1
其中一段代码为shifts = [(i, random.randint(0, 25)) for i in range(len(s)) if s[i-1] == ' ']random.randint(0,25) 是0~25取一个整数X FOR IF 可以用作一行
2015-06-10 22:35:23
1103
原创 Python Object Oriented Programming (面向对象编程) Generator
Write a generator, genPrimes, that returns the sequence of prime numbers on successive calls to its next()method: 2, 3, 5, 7, 11, ...def genPrimes(): primes = [] # primes generated so f
2015-06-09 22:41:26
827
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人