L = [75, 92, 59, 68]
sum = 0.0
for cj in L:
sum = cj + sum
print sum / 4
sum = 0.0
for cj in L:
sum = cj + sum
print sum / 4
2017-03-06
print u'''静夜思\n床前明月光,\n疑是地上霜。\n举头望明月,\n低头思故乡。'''
2017-03-06
print r''''\"To be, or not to be\": that is the question.\nWhether it\'s nobler in the mind to suffer.''',但是报错,不明白错在哪
2017-03-06
python3:
print ('hello,python')
print ("hello,python")
print ('hello','python')
print ('hello,python')
print ("hello,python")
print ('hello','python')
2017-03-06
print 4567+0x12fd2
print "Learn Python in imooc"
print 100 < 99
print 0xff == 255
print "Learn Python in imooc"
print 100 < 99
print 0xff == 255
2017-03-06
此楼正解~
def move(n, a, b, c):
if(n==1):
print a+'-->'+c
else:
move(n-1,a,c,b)
print a+'-->'+c
move(n-1,b,a,c)
move(4, 'A', 'B', 'C')
def move(n, a, b, c):
if(n==1):
print a+'-->'+c
else:
move(n-1,a,c,b)
print a+'-->'+c
move(n-1,b,a,c)
move(4, 'A', 'B', 'C')
2017-03-06
CD是cmd里面的Change Directory ,意思是换目录,因为老师的文件直接保存在了桌面,所以直接cd文件夹名字,但是我们有可能保存在D盘或者别的盘就要:cd /d d:\python\...
2017-03-06
d = {
95: 'Adam',
85: 'Lisa',
59: 'Bart'
}
a = 95
for a =d.keys():
print d.values()
95: 'Adam',
85: 'Lisa',
59: 'Bart'
}
a = 95
for a =d.keys():
print d.values()
2017-03-05