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.'''
2015-05-05
x1 = 1
d = 3
n = 100
x100 = (x1+x1+(n-1)*d)*n/2
s = x100
print s
d = 3
n = 100
x100 = (x1+x1+(n-1)*d)*n/2
s = x100
print s
2015-05-05
print 45678+0x12fd2
print 'Learn Python in imooc'
print 100<99
print 0xff==255
print 'Learn Python in imooc'
print 100<99
print 0xff==255
2015-05-05
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for x in L:
if x in s:
s.remove(x)
else:
s.add(x)
print s
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for x in L:
if x in s:
s.remove(x)
else:
s.add(x)
print s
2015-05-05
sum = 0
x = 0
while True:
x = x + 1
if x > 100:
break
if x%2==0:
continue
sum=sum+x
print sum
x = 0
while True:
x = x + 1
if x > 100:
break
if x%2==0:
continue
sum=sum+x
print sum
2015-05-05
print [x*100+y*10+x for x in range(1,10) for y in range(0,10)]
题目解析有点小问题,既然考虑反转,个位数就必须也是1~9才能是三位数。
题目解析有点小问题,既然考虑反转,个位数就必须也是1~9才能是三位数。
2015-05-05