为了账号安全,请及时绑定邮箱和手机立即绑定
def qs(x):
sum=0
num=1
while num<=x:
sum+=num
num+=1
return sum
print(qs(100))

def fact(n):
if n==1:
return 1
return n+fact(n-1)
print(fact(100))
def sub_sum(L):
sum_ji=0
sum_ou=0
num=1
for x in L:
if num % 2 != 0:
sum_ji+=x
num+=1
else:
sum_ou+=x
num+=1
return sum_ji,sum_ou
print(sub_sum([1,3,2,4,3,5]))
i=1
sum=0
for i in range(101):
sum+=i**2
print(sum)
L = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
S = set([1, 3, 5, 7, 9, 11])
for a in L:
if a in S:
S.remove(a)
else:
S.add(a)
print(S)
d = {
'Alice': 45,
'Bob': 60,
'Candy': 75,
'David': 86,
'Ellena': 49
}
if 'Alice' in d:
result="Alice's old grade is "+str(d['Alice'])
print(result)
d['Alice']=60
print(d)
我也感觉,加上T这个大元组,应该是有4个元组吧。
T = (100, 69, 29, 100, 72, 99, 98, 100, 75, 100, 100, 42, 88, 100)
print(T.count(100))
list=[]
for i in range(10):
list.append(i)
print(tuple(list))
L = ['Alice', 'Bob', 'Candy', 'David', 'Ellena']
N = [89,72,88,79,99]
dictA=dict(zip(L,N))
dictB=sorted(dictA, key=dictA.get, reverse = True)
print(dictB)
d['Alice']=[d['Alice'],60]
你见过我的好朋友Gaven吗,他是个英国人,他不见了
# Enter a code
lengh = 3.14
wide = 1.57
squre = lengh * wide
print(round(squre, 2))
# Enter a code
lengh = 3.14
wide = 1.57
squre = lengh * wide
print(round(wide, 2))
l=['Alice', 'Bob', 'Candy', 'David', 'Ellena']
l[0]='Ellena'
l[1]='Alice'
l[-1]='Bob'
print(l)
print(r'''"To be, or not to be": that is the question.
Whether it's nobler in the mind to suffer.''')

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

微信扫码,参与3人拼团

微信客服

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

帮助反馈 APP下载

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

公众号

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

友情提示:

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

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消