sum = 0
x = 1
n = 1
while True:
sum+=x
x=x^n
n++
if n > 20
break
print sum
x = 1
n = 1
while True:
sum+=x
x=x^n
n++
if n > 20
break
print sum
2015-12-06
sum = 0
x = 1
n = 1
while True:
sum+=x
x=x^n
n++
print sum
x = 1
n = 1
while True:
sum+=x
x=x^n
n++
print sum
2015-12-06
#input code
print 'hello, python'
print 'hello,','python'
print 'hello, python'
print 'hello,','python'
2015-12-06
#Enter a code
print 45678+0x12fd2
print 'Learn Python in imooc'
print 100 < 99
print 0xff == 255
print 45678+0x12fd2
print 'Learn Python in imooc'
print 100 < 99
print 0xff == 255
2015-12-06
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-12-06
print 2.5 + 10 / 4
print 2.5 + 10.0 / 4
print 2.5 + 10 / 4.0
print 2.5 + 10.0 / 4.0
print 2.5 + 10.0 / 4
print 2.5 + 10 / 4.0
print 2.5 + 10.0 / 4.0
2015-12-06
# -*- coding: utf-8 -*-
s = u'''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。
'''
print s.encode('utf8')
s = u'''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。
'''
print s.encode('utf8')
2015-12-06