为了账号安全,请及时绑定邮箱和手机立即绑定
L = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
S = set([1, 3, 5, 7, 9, 11])
for i in L:
if i in S:
S.remove(i)
else:
S.add(i)
print(S)
names = ['Alice', 'Bob', 'Candy', 'David', 'Ellena']
names_set = set(names)
print(names_set)
x="alice"
for i in names_set:
if x.capitalize()==i:
print("True")
d = {'Alice': [50, 61, 66], 'Bob': [80, 61, 66], 'Candy': [88, 75, 90]}
for i in d:
for j in d[i]:
print(i,j)
d = {'Alice': [50, 61, 66], 'Bob': [80, 61, 66], 'Candy': [88, 75, 90]}
print(d.items())

for i,value in d.items():
print(i,value)
# Enter a code
count = 10;
this_num = 0;
while this_num < count:
print(this_num)
this_num+=1
# Enter a code
L = [[75, 92, 59, 68, 99],[8, 2, 6, 4, 8],[715, 952, 589, 698, 919]]
for data in L:
for num in data:
print(num)
# coding: utf-8
kscj=58
if kscj < 60:
print('不及格')
elif kscj >= 60 and kscj <80 :
print("及格")

elif kscj >= 80 and kscj <90:
print("优秀!")
elif kscj >= 90 :
print("顶尖!")
# coding: utf-8
age = 16
if age>18:
print("恭喜你成年了!")
else:
print("小朋友未成年哦!!")
# coding: utf-8
age = 16
if age>18:
print("恭喜你成年了!")
else:
print("小朋友未成年哦!!")
# Enter a code
L = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
S = set([1, 3, 5, 7, 9, 11])
for i in L:
if i in S:
S.remove(i)
else:
S.add(i)
print(S)
T = (1, 'CH', [3, 4])
L = list(T)
L[2] = tuple(L[2])
t = tuple(L)
print(t)
s1 =set([1, 2, 3, 4, 5])
s2 = set([1, 2, 3, 4, 5, 6, 7, 8, 9])
for i in s2.copy():
if i not in s1:
s2.remove(i)
continue
print(s2)
d = {
'Alice': 45,
'Bob': 60,
'Candy': 75,
'David': 86,
'Ellena': 49
}

na=['Alice', 'Bob', 'Candy', 'Mimi', 'David']
for i in na:
if i in d:
print('{}:{}'.format(i,d.get(i)))
else:
print('{}:none'.format(i))
L = ['Alice', 'Bob', 'Candy', 'David', 'Ellena']
L.pop(2)
L.pop(2)
print(L)
names = ['Alice', 'Bob', 'Candy', 'David', 'Ellena']
names.append('Gen')
names.insert(-1, 'Phoebe')
names.append('Zero')
print(names)
课程须知
如果您了解程序设计的基本概念,会简单使用命令行,了解中学数学函数的概念,那么对课程学习会有很大的帮助,让您学起来得心应手,快速进入Python世界。
老师告诉你能学到什么?
通过本课程的学习,您将学会搭建基本的Python开发环境,以函数为基础编写完整的Python代码,熟练掌握Python的基本数据类型以及list和dict的操作,灵活使用流程控制语句。

微信扫码,参与3人拼团

微信客服

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

帮助反馈 APP下载

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

公众号

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

友情提示:

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

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消