为了账号安全,请及时绑定邮箱和手机立即绑定
L = [95.5, 85, 59, 66, 72]
n=len(L)
j=0
for i in range(n):
for j in range(0,n-j-1):
if L[j]<L[j+1]:
L[j], L[j+1] = L[j+1], L[j]
for count in range(n):
if (count<3):
print(L[count])
else:
break
参考答案没错吧
template = 'Life is {a},you need {b}。'
a1='short'
bp='Python'
result=template.format(a=a1,b=bp)
print(result);


template = 'Life {}。'
result=template.format('is short, you need Python')
print(result)
a=3.1415926
b='Learn Python in imooc.'
c=100
d=0b1101
print(type(a))
print(type(b))
print(type(c))
print(type(d))
print(r'''"To be, or not to be": that is the question.
Whether it's nobler in the mind to suffer.''')
print('special string: \', \", \\, \\\\,\\n, \\t')

最新回答 / 幻河
感觉还行
l = [[1, 2, 3], [5, 3, 2], [7, 3, 2]]
for ch in l:
a = ch[0]
b = ch[1]
c = ch[2]
s = 2*(a*b+a*c+b*c)
print(s)
print("\'","\"","\\","\\n","\\t")

最赞回答 / 慕先生9955085
php才是世界上最好的语言;
sum = 0
i = 1
while i <= 100:
sum += i * i
i += 1
print(sum)
L = ['Alice', 66, 'Bob', True, 'False', 100]
i = 1
for ch in L:
i = i+1
if i % 2 == 0:
continue
print(ch)
课程须知
如果您了解程序设计的基本概念,会简单使用命令行,了解中学数学函数的概念,那么对课程学习会有很大的帮助,让您学起来得心应手,快速进入Python世界。
老师告诉你能学到什么?
通过本课程的学习,您将学会搭建基本的Python开发环境,以函数为基础编写完整的Python代码,熟练掌握Python的基本数据类型以及list和dict的操作,灵活使用流程控制语句。

微信扫码,参与3人拼团

微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

友情提示:

您好,此课程属于迁移课程,您已购买该课程,无需重复购买,感谢您对慕课网的支持!

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消