['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
2015-12-21
def greet(b='world'):
print 'Hello,'+b+'.'
greet()
greet('Bart')
print 'Hello,'+b+'.'
greet()
greet('Bart')
2015-12-21
a = 'python'
print 'hello,',a or 'world' #a = 'python' 则 a 是Ture,根据短路计算法则,此表达式结果只与a有关,故直接返回结果 hello,python
b = ''
print 'hello,',b or 'world' # b = '' 则 b 是空字符串 即 b 是Flase,根据短路计算法则,此表达式与b无关,故输出结果 hello,world
print 'hello,',a or 'world' #a = 'python' 则 a 是Ture,根据短路计算法则,此表达式结果只与a有关,故直接返回结果 hello,python
b = ''
print 'hello,',b or 'world' # b = '' 则 b 是空字符串 即 b 是Flase,根据短路计算法则,此表达式与b无关,故输出结果 hello,world
2015-12-20
print [ int(str(x1) + str(x2) + str(x3)) for x1 in range(1, 10) for x2 in range(0, 10) for x3 in range(0, 10) if x1 == x3] 单引号去不掉的那个妹子看这~
2015-12-19
s = 'Python was started in 1989 by \"Guido\".\nPython is free and easy to learn.'
print s
print s
2015-12-18