为了账号安全,请及时绑定邮箱和手机立即绑定
print(r'''"To be, or not to be": that is the question.
Whether it's nobler in the mind to suffer.''')
num=0
sum=0
while True:
if num>1000:
break
sum=sum+num
num=num+2
print(sum)
这样可以么
L = [[1, 2, 3], [5, 3, 2], [7, 3, 2]]
for a in L:
sa = (a[0]*a[1]+a[1]*a[2]+a[0]*a[2])*2
print(sa)

22
62
82
def greet(s='world'):
return 'Hello,{}.'.format(s)
print(greet())
print(greet('Python'))
输出:
Hello,world.
Hello,Python.
看了两天网上的教程,看不懂一个python全排列,看来之前的C都白学了,难受啊
num = 0
sum = 0
while True:
if num > 1000:
break
if num % 2 == 0 :
sum = num + sum
num = num + 1
print(sum) =》 250500
d = {'Alice': [50, 61, 66], 'Bob': [80, 61, 66], 'Candy': [88, 75, 90]}
for key in d:
value = d[key]
for ch in value:
print (key,ch)
print("这是一句中英文混合的%s字符串:%s"%("python","Hello\tWorld"))
template1="Life is short"
template2="you need python"
print("{0},{1}".format(template1,template2))

template="{L},{y}"
L="life is short"
y="you need python"
print(template.format(L=L,y=y))
print(r'''"To be, or not to be":that is the question
Whether it's nobler in the mind to suffer.''')
要用print输出才可以
L = ['Alice', 'Bob', 'Candy', 'David', 'Ellena']
S=[89, 72, 88, 79, 99]
Ss=[89, 72, 88, 79, 99]

def getnames(name):
return Ss.index(name)

S.sort(reverse=True);

for sa in S:
print(sa)

print(L[getnames(sa)])
print(r'''
''')
a = 'python'
print('hello,'+( a or 'world'))
b = ''
print('hello,'+(b or 'world'))
L = [95.5, 85, 59, 66, 72]
L.sort(reverse=True)
for i in range(3):
print(L[i])
c = '{0},{1}'
C=c.format('Life is short', 'you need Python')
print(C)
课程须知
如果您了解程序设计的基本概念,会简单使用命令行,了解中学数学函数的概念,那么对课程学习会有很大的帮助,让您学起来得心应手,快速进入Python世界。
老师告诉你能学到什么?
通过本课程的学习,您将学会搭建基本的Python开发环境,以函数为基础编写完整的Python代码,熟练掌握Python的基本数据类型以及list和dict的操作,灵活使用流程控制语句。

微信扫码,参与3人拼团

微信客服

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

帮助反馈 APP下载

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

公众号

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

友情提示:

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

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消