加u通不过
# -*- coding: utf-8 -*-
print '''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''
# -*- coding: utf-8 -*-
print '''静夜思\n床前明月光,\n疑是地上霜。\n举头望明月,\n低头思故乡。'''
# -*- coding: utf-8 -*-
print '''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''
# -*- coding: utf-8 -*-
print '''静夜思\n床前明月光,\n疑是地上霜。\n举头望明月,\n低头思故乡。'''
2016-02-23
s = 'Python was started in 1989 by "Guido". \n Python is free and easy to learn.'
print s
print s
2016-02-23
x1 = 1
d = 3
n = 100
x100 = x1+n*d
s = n*x1+n*(n-1)*d/2
print s
d = 3
n = 100
x100 = x1+n*d
s = n*x1+n*(n-1)*d/2
print s
2016-02-23
sum = 0
x = 1
while x<100 && x%2==1:
sum+=x
print sum
x = 1
while x<100 && x%2==1:
sum+=x
print sum
2016-02-23
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.'''
2016-02-23
s = 'Python was started in 1989 by \"Guido\".\t\nPython is free and easy to learn.'
print s
print s
2016-02-23
x1 = 1
d = 3
n = 100
xn = x1 + (n-1)*d
s = (x1+xn)*n/2
print xn
print s
d = 3
n = 100
xn = x1 + (n-1)*d
s = (x1+xn)*n/2
print xn
print s
2016-02-23
L = [1]
n=1
while n<100:
L.insert(n,(n+1)*(n+1))
n=n+1
print sum(L)
n=1
while n<100:
L.insert(n,(n+1)*(n+1))
n=n+1
print sum(L)
2016-02-23
def move(n, a, b, c):
if n==1:
print a,'-->',c
else:
print a,'-->',b
move(n-1,a,b,c)
print b,'-->',c
return
move(4, 'A', 'B', 'C')
我认为应该是这样写的
输出:
A --> B
A --> B
A --> B
A --> C
B --> C
B --> C
B --> C
if n==1:
print a,'-->',c
else:
print a,'-->',b
move(n-1,a,b,c)
print b,'-->',c
return
move(4, 'A', 'B', 'C')
我认为应该是这样写的
输出:
A --> B
A --> B
A --> B
A --> C
B --> C
B --> C
B --> C
2016-02-22