为了账号安全,请及时绑定邮箱和手机立即绑定
# Enter a code
T=(1,'CH',[3,4])
L=list(T)
L[2]=tuple(L[2])
T=tuple(L)
print(T)
l=['Alice','Bob','Candy','David','Ellena']
s=[89,72,88,79,99]
k=[]
i=0
for ch in l:
k.append([ch,s[i]])
i=i+1
s.sort(reverse=True)
m=[]
for ch in s:
for p in k:
if p[1]==ch:
m.append("{}-{}".format(p[0],ch))
break
print(m)
cou=['Chinese','Math','English'];ach=[92,75,99]
i=0
for x in cou:
print("{}:{}".format(x,ach[i]))
i=i+1
这是不是简化了,Python感觉好不适应啊
teae='这是一句中英文混合的python字符串:Hello World!'
print(teae)
a='Life is short, {}.'
b='you need python'
c=a.format(b)
print(c)#=


or

a='Life is short, {}.'
c=a.format('you need python')
print(c)#=
s1='ABC'
s2='123'
s3='syz'
for q in s1:
for w in s2:
for e in s3:
print(q+w+e)
a= 1
s= 1
while a>0 and a <= 100:
a=a+1
s=s*a

print (s);
a=(r'''"To be,or not to be":that is the question.
Wheth er it's nobler in the mind to suffer.''')
print(a)
print(r'''"To be,or not to be":that is the question.
Wheth er it's nobler in the mind to suffer''')
print('special string:\',\",\\,\\\\,\\n,\\t')
b=''
>>> print('hello,',b or 'world')
hello, world



我发现,里面只要是空格,就会输出空格,''代表着Flase所以才输出后面的,而' <空格>'就是代表字符是True,所以会输出
a=' '
>>> print('b',a or 'c')
age = 19
if age>= 18:
print('adult',age)
s1 = 'ABC'
D = '123'
E = 'xyz'
for a in s1:
for b in D:
for c in E:
print(a + b + c)
print(b + a + c)
print(a + c + b)
print(b + c + a)
print(c + a + b)
print(c + b + a)
a='AABCDEFGHHIJ'

print(a[1:9])
课程须知
如果您了解程序设计的基本概念,会简单使用命令行,了解中学数学函数的概念,那么对课程学习会有很大的帮助,让您学起来得心应手,快速进入Python世界。
老师告诉你能学到什么?
通过本课程的学习,您将学会搭建基本的Python开发环境,以函数为基础编写完整的Python代码,熟练掌握Python的基本数据类型以及list和dict的操作,灵活使用流程控制语句。

微信扫码,参与3人拼团

微信客服

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

帮助反馈 APP下载

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

公众号

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

友情提示:

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

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消