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

為了賬號安全,請及時綁定郵箱和手機立即綁定
a = 18
if a > 18:
print('成年人')
else:
print('未成年')
最后任務的標準答案是啥
template = 'Life is short, {}'
a = 'you need Python'
result = template.format(a)
print(result)

template = 'Life is short, {a}'
b = 'you need Python'
result1 = template.format(a = b)
print(result1)
def my_func(x):
if isinstance(x, list):
return sum(x)
elif isinstance(x, tuple):
num = 1
for item in x:
num = item*num
return num


x = (12, 34, 56, 43, 65)
print(my_func(x))
def sub_sum(l):
sum_even = 0
sum_odd = 0
for num in l:
if num % 2 == 0:
sum_even = num + sum_even
else:
sum_odd = num + sum_odd

return sum_even, sum_odd

l = [1,2,3,4,5,6,7,8,9,10]
sum_even, sum_odd = sub_sum(l)
print(sub_sum(l))
print('Hello world')
s1 = set([1, 2, 3, 4, 5])
s2 = set([1, 2, 3, 4, 5, 6, 7, 8, 9])
if s1.isdisjoint(s2)==False:
for numbers_overlap in s1:
if numbers_overlap in s2:
print(numbers_overlap)

#so if there are numbers(numbers_overlap) in s1 found in set 2, print the numbers_overlap
L = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
S = set([1, 3, 5, 7, 9, 11])

# if ( item_L) is in S, it should be deleted from set, if not, it should be added into set.
for item_L in L:
if item_L in S:
S.remove(item_L)
else:
S.add(item_L)
print(S)
L = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
S = set([1, 3, 5, 7, 9, 11])
for i in L:
S1 = S
S1.add(i)
if S != S1:
S.add(i)
S1.remove(i)
else:
S.remove(i)

print(S)
names= [ 'Alice' ,'Bob','Candy','David','Ellena' ]
names.append('Zero')
names.insert(-2'phoebe')
names.insert(-3'Gen')
prent(names)
課程須知
如果您了解程序設計的基本概念,會簡單使用命令行,了解中學數學函數的概念,那么對課程學習會有很大的幫助,讓您學起來得心應手,快速進入Python世界。
老師告訴你能學到什么?
通過本課程的學習,您將學會搭建基本的Python開發環境,以函數為基礎編寫完整的Python代碼,熟練掌握Python的基本數據類型以及list和dict的操作,靈活使用流程控制語句。

微信掃碼,參與3人拼團

微信客服

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

幫助反饋 APP下載

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

公眾號

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

友情提示:

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

本次提問將花費2個積分

你的積分不足,無法發表

為什么扣積分?

本次提問將花費2個積分

繼續發表請點擊 "確定"

為什么扣積分?

舉報

0/150
提交
取消