为了账号安全,请及时绑定邮箱和手机立即绑定
L = [[1,2,3],[5,3,2],[7,3,2]]
for i in range(len(L)):
a = 1
for j in L[i]:
a *= j
print(a)
_list=[95.5, 85, 59, 66, 72]
_list=sorted(_list,reverse=True)
print(_list[0:3])
所以这个课程没有结果效果图,第一时间不知道结果对不对
a = 'python'
print('hello,', a or 'world')
b = ''
print('hello,', b or 'world')
def greet(n='world!'):
if not isinstance(n, str):
print('Hello,{}'.format(str(n)))
else:
print('Hello,{}'.format(n))

greet()
greet('ccc')
greet(111)
greet((1,2,3,4))
s1 = set([1, 2, 3, 4, 5])
s2 = set([1, 2, 3, 4, 5, 6, 7, 8, 9])
print('-----------')
c_set = set()
if not s2.isdisjoint(s1):
for item in s1:
if item in s2:
c_set.add(item)
print(c_set)
不知道对不对
a = 3.1415926;
b = 'Learn Python in imooc.';
c = 100;
d = 0b1101;

print(type(a),type(b),type(c),type(d))
# Enter a code
d = {
'Alice': [45],
'Bob': [60],
'Candy': [75],
}
L= ([50, 61, 66],[80, 61, 66],[88, 75, 90])
num = 0
for item in d:
d[item] = L[num]
i = num+1
print(d)
d = {
'Alice': 45,
'Bob': 60,
'Candy': 75,
'David': 86,
'Ellena': 49
}
L = ('Alice', 'Bob', 'Candy', 'Mimi', 'David')
for item in L:
print('{}:{}'.format(item,d.get(item)))
L = [[1, 2, 3], [5, 3, 2], [7, 3, 2]]
for item in L:
num = 1
for i in item:
num = i*num
print(num)
L = ['Alice', 66, 'Bob', True, 'False', 100]
num = 1
for c in L:
if num % 2 == 0:
print(c)
num += 1
age = 19
if age >= 18:
temp = 'adult {}'
print(temp.format(age))
# Enter a code
template = 'Life is {0}, {1} {2} {3}'
template1 = 'Life is {a},{b},{c} {d}'
print(template.format("short","you","need","python"))
aa='short'
bb = 'you'
cc = 'need'
dd = 'python'
print(template1.format(a=aa,b=bb,c=cc,d=dd))
课程须知
如果您了解程序设计的基本概念,会简单使用命令行,了解中学数学函数的概念,那么对课程学习会有很大的帮助,让您学起来得心应手,快速进入Python世界。
老师告诉你能学到什么?
通过本课程的学习,您将学会搭建基本的Python开发环境,以函数为基础编写完整的Python代码,熟练掌握Python的基本数据类型以及list和dict的操作,灵活使用流程控制语句。

微信扫码,参与3人拼团

微信客服

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

帮助反馈 APP下载

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

公众号

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

友情提示:

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

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消