L=[]
for m in range(1,10):
for n in range(0,10):
L.append(100*m+10*n+m)
print L
for m in range(1,10):
for n in range(0,10):
L.append(100*m+10*n+m)
print L
2016-02-15
已采纳回答 / 小王荟
因为求平均值会有小数,所以sum如果带有浮点数,它的整体运算结果就会用小数来表示第二个语句的意思是x会被2整除。x%2的意思是x除以2的余数,==为判等(比较两边的东西是否一样),整个的意思就是:如果x会被2除,得到的余数为0,那么就执行下面的代码
2016-02-15
L = ['Adam', 'Lisa', 'Paul', 'Bart']
L.pop(2)
L.pop(2)
print L
L.pop(2)
L.pop(2)
print L
2016-02-15
L = [95.5,85,59]
print L[0]
print L[1]
print L[2]
print L[-1]
print L[0]
print L[1]
print L[2]
print L[-1]
2016-02-15
实测3.0直接输出正确...
print(u'''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。''')
print(u'''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。''')
2016-02-15
3.0
print (r'''"To be, or not to be": that is the question.
Whether it's nobler in the mind to suffer.''')
print (r'''"To be, or not to be": that is the question.
Whether it's nobler in the mind to suffer.''')
2016-02-15
print("Python was started in 1989 by \"Guido\".")
print("Python is free and easy to learn.")
print("Python is free and easy to learn.")
2016-02-15
3.0
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)
2016-02-15