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

為了賬號安全,請及時綁定郵箱和手機立即綁定
def my_work(**kwargs):
for j , i in enumerate(kwargs.get('names')):
print('姓名:{},性別:{},年齡:{}'.format(i,kwargs.get('gender')[j],kwargs.get('age')[j]))
return

my_work(names=['熊貓','大象','狗熊'],gender=['男','女','男'],age=[18,28,33])
奇數項和偶數項是指列表元素的奇偶還是列表索引的奇偶
def square_of_sum(L):
L1=[]
for i in L:
L1.extend([i*i])
return sum(L1)
print(square_of_sum([1, 2, 3, 4, 5]))
names = ['Alice', 'Bob', 'Candy', 'David', 'Ellena']
new_names=[]
for i in names:
name_lower=i.lower()
new_names.append(name_lower)
print(new_names)
s = {'Alice', 'Bob', 'Candy', 'David', 'Ellena'}
d = dict()
d['Alice'] = [50, 61, 66]
d['Bob'] = [80, 61, 66]
d['Candy'] = [88, 75, 90]
d["Gaven"]=86
num = 2
sum = 0
while True:
if num > 1000:
break
sum = sum + num
num = num + 2
print(sum) # ==> 250500
# coding: utf-8
s1 = '這是一句中英文混合的{}字符串:{}'
python = 'Python'
hello = 'Hello World!'
result = s1.format(python , hello)
print(result)
t = (100, 69, 29, 100, 72, 99, 98, 100, 75, 100, 100,42, 88, 100)
print(t.count(100))
In [13]:
?
def vcb(**c):
namess = c['names']
genderss = c['genders']
agess = c['ages']
index = 0
for name in namess:
gender = genderss[index]
age = agess[index]
index += 1
print(name + ' is a ' + gender + ' of '+ age)
#輸入時注意列表里面的元素都為字符串即可
In [9]:
?
def vcb(names,genders,ages):
index = 0
for name in names:
gender = genders[index]
age = ages[index]
index += 1
print(name + ' is a ' + gender + ' of '+ age)
#輸入時注意列表里面的元素都為字符串即可
def hancan(x):
listhe = 0
tuplehe = 1
if isinstance(x,list):
for i in x:
listhe += i
return listhe
elif isinstance(x,tuple):
for j in x:
tuplehe *= j
return tuplehe
else:
return '數據類型有誤'
或運算下
a是字符串,判斷為ture 返回a
b是空字符串判斷為false,結果取決于world,返回world
輸出hello Python
hello world
課程須知
如果您了解程序設計的基本概念,會簡單使用命令行,了解中學數學函數的概念,那么對課程學習會有很大的幫助,讓您學起來得心應手,快速進入Python世界。
老師告訴你能學到什么?
通過本課程的學習,您將學會搭建基本的Python開發環境,以函數為基礎編寫完整的Python代碼,熟練掌握Python的基本數據類型以及list和dict的操作,靈活使用流程控制語句。

微信掃碼,參與3人拼團

微信客服

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

幫助反饋 APP下載

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

公眾號

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

友情提示:

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

本次提問將花費2個積分

你的積分不足,無法發表

為什么扣積分?

本次提問將花費2個積分

繼續發表請點擊 "確定"

為什么扣積分?

舉報

0/150
提交
取消