基本上是ascii编码方式,由此Python自然调用ascii编码解码程序去处理字符流,当字符流不属于ascii范围内,就会抛出异常(ordinal not in range(128))需要添加 引入sys才可以额
2019-04-02
print 'hello,python'
print 'hello,'+'python.'
print 'hello,'+'python.'
2019-04-02
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 x + y
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 x * 10 + y
for y in ['0','1','2','3','4','5','6','7','8','9',]:
if x < y:
print x + y
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 x * 10 + y
2019-04-01
#Enter a code
print (45678+0x12fd2)
print 'Learn Python in imooc'
print (100<9)
print (0xff==255)
print (45678+0x12fd2)
print 'Learn Python in imooc'
print (100<9)
print (0xff==255)
2019-04-01
for x in range(0,10):
for y in range(0,10):
if not y>x:
continue
print 10*x+y
for y in range(0,10):
if not y>x:
continue
print 10*x+y
2019-04-01
# -*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf8')
print u'''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''
import sys
reload(sys)
sys.setdefaultencoding('utf8')
print u'''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''
2019-03-31