def count():
fs = []
for i in range(1, 4):
def f():
return i * i
fs.append(f())
return fs
f1, f2, f3 = count()
print f1, f2, f3
fs = []
for i in range(1, 4):
def f():
return i * i
fs.append(f())
return fs
f1, f2, f3 = count()
print f1, f2, f3
2016-06-12
try:
print p.__score
except Exception, e:
print Exception, e
print("我要过关")
print "attributeerror"
print p.__score
except Exception, e:
print Exception, e
print("我要过关")
print "attributeerror"
2016-06-11
import math
def is_sqr(x):
return math.sqrt(x).is_integer()
print filter(is_sqr, range(1, 101))
def is_sqr(x):
return math.sqrt(x).is_integer()
print filter(is_sqr, range(1, 101))
2016-06-11
def count():
fs = []
for i in range(1, 4):
num = i*i
def f(m=num):
def ff():
return m
return ff
fs.append(f(num))
return fs
f1, f2, f3 = count()
print f1(), f2(), f3()
正解。
fs = []
for i in range(1, 4):
num = i*i
def f(m=num):
def ff():
return m
return ff
fs.append(f(num))
return fs
f1, f2, f3 = count()
print f1(), f2(), f3()
正解。
2016-06-11
str.capitalize()
Return a copy of the string with its first character capitalized and the rest lowercased.
For 8-bit strings, this method is locale-dependent.
Return a copy of the string with its first character capitalized and the rest lowercased.
For 8-bit strings, this method is locale-dependent.
2016-06-11
对time模块和我一样懵逼的可以看看这个博客,讲得很清楚了。 http://blog.csdn.net/kiki113/article/details/4033017
2016-06-11