亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
age=19
if age >=18:
print(‘adult’,age)
d = {
'Alice': [45],
'Bob': [60],
'Candy': [75],
}
d['Alice'].extend((50,61,66))
d['Bob'].extend((80,61,66))
d['Candy'].extend((88,75,90))
print(d)
# coding=utf-8
def my_sumB(n):
sum = 0
if n == 1:
sum = n
else:
sum = n + my_sumB(n - 1)
return sum
print(my_sumB(100))
# coding=utf-8
def sub_sum(l):
index=0
sum1=0
sum2=0
for a in l:
if index % 2 ==0:
sum1+=a
else:
sum2+=a
index += 1
return sum1,sum2
l=[1,2,1,4,5,8,6]
sum1,sum2=sub_sum(l)
print('偶數項和={}'.format(sum1))
print('奇數項和={}'.format(sum2))
# Enter a code
l=[]
x=0
while x<=100:
l.append(x*x)
x=x+1
print(sum(l))
# Enter a code
t=(100, 69, 29, 100, 72, 99, 98, 100, 75, 100, 100, 42, 88, 100)
a=t.count(100)
print(a)
# Enter a code
s1 = set([1, 2, 3, 4, 6, 8, 10])
s2 = set([1, 2, 3, 4, 5, 6, 7, 8, 9])
flag = s1.isdisjoint(s2)
if not flag:
for item in s1:
if item not in s2:
continue
print(item)
# Enter a code
s1 = set([1, 2, 3, 4, 6, 8, 10])
s2 = set([1, 2, 3, 4, 5, 6, 7, 8, 9])
flag = s1.isdisjoint(s2)
if not flag:
for item in s1:
if item not in s2:
continue
print(item)
dist = {
'Alice': 45,
'Bob': 60,
'Candy': 75,
'David': 86,
'Ellena': 49
}
name = '孫雯'
if name in dist.keys():
dist.pop(name)
else:
print('{} not in dist'.format(name))
d = {
'Alice': 45,
'Bob': 60,
'Candy': 75,
'David': 86,
'Ellena': 49
}
for name in d:
print(d.get(name))
d = {
'Alice': 45,
'Bob': 60,
'Candy': 75,
'David': 86,
'Ellena': 49,
'Gaven':86
}
print(d)
# Enter a code
s1='ABC'
s2='123'
s3='xyz'
for x in s1:
for y in s2:
for z in s3:
print(x+y+z)
# Enter a code
T=(100, 69, 29, 100, 72, 99, 98, 100, 75, 100, 100, 42, 88, 100)
print(T.count(100))
tuple=(0,1,2,3,4,5,6,7,8,9)
L=list(tuple)
print(L)
# Enter a code
a=1
b=1
while a>0 and a<=10:
b=b*a
a=a+1
print(b)
課程須知
如果您了解程序設計的基本概念,會簡單使用命令行,了解中學數學函數的概念,那么對課程學習會有很大的幫助,讓您學起來得心應手,快速進入Python世界。
老師告訴你能學到什么?
通過本課程的學習,您將學會搭建基本的Python開發環境,以函數為基礎編寫完整的Python代碼,熟練掌握Python的基本數據類型以及list和dict的操作,靈活使用流程控制語句。

微信掃碼,參與3人拼團

微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號

友情提示:

您好,此課程屬于遷移課程,您已購買該課程,無需重復購買,感謝您對慕課網的支持!

本次提問將花費2個積分

你的積分不足,無法發表

為什么扣積分?

本次提問將花費2個積分

繼續發表請點擊 "確定"

為什么扣積分?

舉報

0/150
提交
取消