s = 'Python was started in 1989 by "Guido".\nPython is free and easy to learn.'
2015-06-22
一般这道题,是不能拿名字直接赋值的,法一:
L.append(L.pop(0))
L.insert(0,L.pop(1))
# second choice
# L[0],L[-1] = L[-1],L[0]
L.append(L.pop(0))
L.insert(0,L.pop(1))
# second choice
# L[0],L[-1] = L[-1],L[0]
2015-06-22
>>> a = 'python'
>>> print 'hello,', a or 'world'
hello, python
>>>
>>> b = ''
>>> print 'hello,', b or 'world'
hello, world
>>>
>>> print 'hello,', a or 'world'
hello, python
>>>
>>> b = ''
>>> print 'hello,', b or 'world'
hello, world
>>>
2015-06-21