为了账号安全,请及时绑定邮箱和手机立即绑定
L = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
S = set([1, 3, 5, 7, 9, 11])
for item in L:
if item in S:
S.remove(item)
print(S)
name_set = set()
name1 = (['Jenny', 'Ellena', 'Alice', 'Candy', 'David', 'Hally', 'Bob', 'Isen', 'Karl'])
name_set.update(name1)
print(name_set)
name_set2 = set()
for item in name1:
name_set2.add(item)
print(name_set2)
names = ['Alice', 'Bob', 'Candy', 'David', 'Ellena']
name_set = set(names)
name_set2 = set()
for name in name_set:
name_set2.add(name.lower())
print('bob'.lower() in name_set2)
d = {'Alice': [50, 61, 66], 'Bob': [80, 61, 66], 'Candy': [88, 75, 90]}
num = 0;
for value in d.values():
for item in value:
num += 1
print(num)
T = (1, 'CH', [3, 4])
l = list(T)
l[2] = tuple(l[2])
t2 = tuple(l)
print(t2)
t = (100, 69, 29, 100, 72, 99, 98, 100, 75, 100, 100, 42, 88, 100)
print(t.count(100))
L = [[1, 2, 3], [5, 3, 2], [7, 3, 2]]
for item in L:
s1 = 2* (item[0]*item[1]+item[1]*item[2]+item[0]*item[2])
print(s1)
L = ['Alice', 'Bob', 'Candy', 'David', 'Ellena']
s = [89, 72, 88, 79, 99]
ls = []
r = []
i = 0
for item in L:
ls.append([item,s[i]])
i += 1
s.sort(reverse=True)
for item in s:
for score in ls:
if score[1] == item:
r.append(score[0])
print(r)
L = ['Alice', 'Bob', 'Candy', 'David', 'Ellena']
L.pop(2)
L.pop(2)
print(L)
names = ['Alice', 'Bob', 'Candy', 'David', 'Ellena']
names.append('Zero')
names.insert(5,'Phoebe')
names.insert(5,'Gen')
print(names)
L = [95.5, 85, 59, 66, 72]
L.sort(reverse=False)
print(L[-1],L[-2],L[-3])
L = [95.5, 85, 59, 66, 72]
L.sort(reverse=True)
print(L[0:3])
L = ['Alice', 66, 'Bob', True, 'False', 100]
num = 0
for item in L:
if num%2==0:
print(item)
num = num+1
else:
num = num +1
scores = ['Chinese',92,'Math',75,'English',99]
print(scores)
# Enter a code
s1='ABC'
s2='123'
s3='xyx'
for x in s1:
for y in s2:
for z in s3:
print(x + y + z)
课程须知
如果您了解程序设计的基本概念,会简单使用命令行,了解中学数学函数的概念,那么对课程学习会有很大的帮助,让您学起来得心应手,快速进入Python世界。
老师告诉你能学到什么?
通过本课程的学习,您将学会搭建基本的Python开发环境,以函数为基础编写完整的Python代码,熟练掌握Python的基本数据类型以及list和dict的操作,灵活使用流程控制语句。

微信扫码,参与3人拼团

意见反馈 帮助中心 APP下载
官方微信
友情提示:

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

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消