已采纳回答 / 这位童鞋很懒
可能是Python版本的原因,改成print ('hello world!')试试看,参考https://zhidao.baidu.com/question/1175043581404108379.html
2016-11-14
L=zip((x for x in range(1,100,2)),(x+1 for x in range(1,100,2)))
print [m*n for m,n in L]
print [m*n for m,n in L]
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-11-14
s = 'Python was started in 1989 by \"Guido\".\n Python is free and easy to learn.'
print s
print s
2016-11-14
L = [75, 92, 59, 68]
sum = 0.0
for score in L:
sum+=score
print sum / 4
这样都过不去?
sum = 0.0
for score in L:
sum+=score
print sum / 4
这样都过不去?
2016-11-14
给大家一个zip方式
a=[1,2,3]
b=['a','c','d']
s=zip(a,b)
print s'''
a=[1,2,3]
b=['a','c','d']
s=zip(a,b)
print s'''
def move(n, a, b, c):
if n==1:
print 'a-->c'
return
else:
move(n-1,a,c,b)
print 'a-->b'
move(n-1,b,a,c)
print 'a-->c'
move(4, 'A', 'B', 'C')我的代码
if n==1:
print 'a-->c'
return
else:
move(n-1,a,c,b)
print 'a-->b'
move(n-1,b,a,c)
print 'a-->c'
move(4, 'A', 'B', 'C')我的代码
2016-11-14
def move(n, a, b, c):
if n==1:
print 'a-->c'
return
else:
move(n-1,a,c,b)
print 'a-->b'
move(n-1,b,a,c)
print 'a-->c'
move(4, 'A', 'B', 'C')
if n==1:
print 'a-->c'
return
else:
move(n-1,a,c,b)
print 'a-->b'
move(n-1,b,a,c)
print 'a-->c'
move(4, 'A', 'B', 'C')
2016-11-14