单元素 tuple 要多加一个逗号“,” >>> t = (1,)
多元素 tuple 加不加这个额外的“,” >>> t = (1,2,3)
多元素 tuple 加不加这个额外的“,” >>> t = (1,2,3)
2015-10-14
print [100*a + 10*b + c for a in range(1, 10) for b in range(0, 10) for c in range(0,10) if a == c]
2015-10-14
L = [95.5, 85, 59,59]
print L[-1]
print L[-2]
print L[-3]
print L[-4]
这样就能过
print L[-1]
print L[-2]
print L[-3]
print L[-4]
这样就能过
2015-10-14
for x in [1,2,3,4,5,6,7,8,9]:
for y in [0,1,2,3,4,5,6,7,8,9]:
if x<y:
print 10*x+y
for y in [0,1,2,3,4,5,6,7,8,9]:
if x<y:
print 10*x+y
2015-10-13
print r'''"To be,or not to be":
that is the question.
Whether it's nobler in the mind to suffer.'''
that is the question.
Whether it's nobler in the mind to suffer.'''
2015-10-13
r'\(~_~)/ \(~_~)/'
print '''Line 1
Line 2
Line 3'''
print 'Line 1\nLine 2\nLine 3'
print '''Python is created by "Guido".
It is free and easy to learn.
Let's start learn Python in imooc!'''
print '''Line 1
Line 2
Line 3'''
print 'Line 1\nLine 2\nLine 3'
print '''Python is created by "Guido".
It is free and easy to learn.
Let's start learn Python in imooc!'''
2015-10-13
sum = 0
x = 1
while x < 100:
x += 2
sum += x
print sum
x = 1
while x < 100:
x += 2
sum += x
print sum
2015-10-13
L = [95.5,85,59]
print max(L)
print L[1]
print L[2]
print L[2]
print max(L)
print L[1]
print L[2]
print L[2]
2015-10-13