为了账号安全,请及时绑定邮箱和手机立即绑定
s1='ABC'
s2='123'
s3='xyz'
for s11 in s1:
for s22 in s2:
for s33 in s3:
print(s11+s22+s33)
# coding: utf-8
s1 = '这是一句中英文混合的Python字符串:'
s2 = 'Hello World!'
print(s1+s2)
result = 's1{s2}'.format(s2='Hello World!')
print(result)
num = 0
sum = 0
while True:
if num>1000:
break
sum = sum + num
num = num + 2
print(sum)
num = 1
plus = 1
while num <= 20:
plus = plus * num
num = num + 1
print(plus)
L = [75, 92, 59, 68, 99, 100, 87, 71]
sum = 0.0
count = len(L)
for score in L:
sum = sum + score
ave = sum/count
print(sum,count)
print(ave)
# Enter a code
age = 17
a = 'your age is {}, and you are a {}.'
if age>=18:
print(age, a.format(age, 'adult'))
else:
print(age, a.format(age, 'child'))
http://www.sogou.com
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')
爱你!爱你爱你!
python=(a+b+c)
a=hei
b=lo
c=world
print(浮点数)
print(字符串)
print(整数)
print (二进制)
因为短路计算,所以a=python时不计算or,直接返回python。
当b=空格,所以b=false;false or world=world
def getSecond(elem):

return elem[1]


L = [('Alice',89), ('Bob',72), ('Candy',88), ('David',79), ('Ellena',99)]

#把list的每个元素的key赋值为各个元素的下标为1的值,然后list按key的数值大小进行排序
L.sort(key=getSecond,reverse=True)

print(L)

list = []

for item in L:
list.append(item[0])
print(list)
# 多行用''' ''' 注释 前缀加r就不用加转义符/
# 上述为多行不用转述,所以r'''
课程须知
如果您了解程序设计的基本概念,会简单使用命令行,了解中学数学函数的概念,那么对课程学习会有很大的帮助,让您学起来得心应手,快速进入Python世界。
老师告诉你能学到什么?
通过本课程的学习,您将学会搭建基本的Python开发环境,以函数为基础编写完整的Python代码,熟练掌握Python的基本数据类型以及list和dict的操作,灵活使用流程控制语句。

微信扫码,参与3人拼团

微信客服

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

帮助反馈 APP下载

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

公众号

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

友情提示:

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

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消