# -*- coding: utf-8 -*-
print '''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''
print '''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''
2018-05-15
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.'''
2018-05-15
L = []
for x in range(1, 101):
L.append(x*x)
print L
sum = 0
for y in L:
sum =sum +y
print sum
只会简单的
for x in range(1, 101):
L.append(x*x)
print L
sum = 0
for y in L:
sum =sum +y
print sum
只会简单的
2018-05-15
print r'''"To be, or not to be": that is the question. .\nWhether it's nobler in the mind to suffer.'''
2018-05-15
L = []
i = 1
while i <= 100:
L.append(i*i)
i = i + 1
print sum(L)
i = 1
while i <= 100:
L.append(i*i)
i = i + 1
print sum(L)
2018-05-15
def toUppers(L):
return map(lambda y:y.upper(),filter(lambda x: isinstance(x,str),L))
print toUppers(['Hello', 'world', 101])
return map(lambda y:y.upper(),filter(lambda x: isinstance(x,str),L))
print toUppers(['Hello', 'world', 101])
s='Python was started in 1989 by\"Guido\".\nPython is free and easy to learn.'
print s
print s
2018-05-15
L = ['Adam', 95.5, 'Lisa', 85, 'Bart', 59]
print L
print L
2018-05-15
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
2018-05-15
# -*- coding: utf-8 -*-
print r'''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''
print r'''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''
2018-05-15
L = ['Adam', 'Lisa', 'Bart', 'Paul']
#for index, name in enumerate(L,1):
for index,name in zip(range(1,len(L)+1),L):
print index, '-', name
#for index, name in enumerate(L,1):
for index,name in zip(range(1,len(L)+1),L):
print index, '-', name
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.'''
2018-05-15