from math import *
def is_sqr(x):
if sqrt(x) % 1 == 0:
return x
print filter(is_sqr, range(0, 101))
def is_sqr(x):
if sqrt(x) % 1 == 0:
return x
print filter(is_sqr, range(0, 101))
2016-09-22
return '(student: %s, %s, %s)'%(self.name,self.gender,self.score)
2016-09-22
from os.path import isdir,isfile
print isdir(r'/data/webroot/resource')
print isfile(r'/data/webroot/resource/test.txt')
print isdir(r'/data/webroot/resource')
print isfile(r'/data/webroot/resource/test.txt')
2016-09-22
super(Teacher, self).__init__(name, gender) 这样感觉好长啊,如果能简化成es6那样的语法就很简洁了:super(name, gender)
2016-09-21
from os.path import isdir, isfile
print isdir(r'/data/webroot/resource/')
print isfile(r'/data/webroot/resource/python/test.txt')
print isdir(r'/data/webroot/resource/')
print isfile(r'/data/webroot/resource/python/test.txt')
2016-09-20