for x in [ 1,2,3,4,5,6,7,8]:
for y in [1,2,3,4,5,6,7,8,9]:
if ( x<y ):
print 10*x+y
for y in [1,2,3,4,5,6,7,8,9]:
if ( x<y ):
print 10*x+y
2016-12-02
print [a + b + c for a in '123456789' for b in '0123456789' for c in '123456789' if a == c]
string型。。。。
string型。。。。
2016-12-02
def square_of_sum(L):
s = 0
for i in L:
s = s + (i * i)
return s
print square_of_sum([1, 2, 3, 4, 5])
print square_of_sum([-5, 0, 5, 15, 25])
s = 0
for i in L:
s = s + (i * i)
return s
print square_of_sum([1, 2, 3, 4, 5])
print square_of_sum([-5, 0, 5, 15, 25])
2016-12-02
print r'''"To be, or not to be": that is the question.
Whether it's nobler in the mind to suffer.'''
Whether it's nobler in the mind to suffer.'''
2016-12-02
s = 'Python was started in 1989 by\"Guido\".\nPython is free and easy to learn.'
print s
print s
2016-12-02