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

為了賬號安全,請及時綁定郵箱和手機立即綁定
參考答案沒錯吧
template = 'Life is {a},you need 。'
a1='short'
bp='Python'
result=template.format(a=a1,b=bp)
print(result);


template = 'Life {}。'
result=template.format('is short, you need Python')
print(result)
a=3.1415926
b='Learn Python in imooc.'
c=100
d=0b1101
print(type(a))
print(type(b))
print(type(c))
print(type(d))
print(r'''"To be, or not to be": that is the question.
Whether it's nobler in the mind to suffer.''')
print('special string: \', \", \\, \\\\,\\n, \\t')
l = [[1, 2, 3], [5, 3, 2], [7, 3, 2]]
for ch in l:
a = ch[0]
b = ch[1]
c = ch[2]
s = 2*(a*b+a*c+b*c)
print(s)
print("\'","\"","\\","\\n","\\t")
sum = 0
i = 1
while i <= 100:
sum += i * i
i += 1
print(sum)
L = ['Alice', 66, 'Bob', True, 'False', 100]
i = 1
for ch in L:
i = i+1
if i % 2 == 0:
continue
print(ch)
L = [95.5, 85, 59, 66, 72]
L.sort(reverse=True)
sub_L = L[0:3]
print(sub_L)
3.1415926-------浮點數
'Learn Python in imooc.'-----字符串
100-----整數
0b1101-----二進制數
sum=sum+n*n,實際上就等同于sum+=n*n,也就是n*n相加的意思
d = {'Alice': [50, 61, 66], 'Bob': [80, 61, 66], 'Candy': [88, 75, 90]}
num=0
for key in d.keys():
num=num+1
print(num)
d = {
'Alice': 45,
'Bob': 60,
'Candy': 75,
'David': 86,
'Ellena': 49
}
for item in d.keys():
if item=='Alice':
print("old_score:"+str(d['Alice']))
d['Alice']=60
print(d)
課程須知
如果您了解程序設計的基本概念,會簡單使用命令行,了解中學數學函數的概念,那么對課程學習會有很大的幫助,讓您學起來得心應手,快速進入Python世界。
老師告訴你能學到什么?
通過本課程的學習,您將學會搭建基本的Python開發環境,以函數為基礎編寫完整的Python代碼,熟練掌握Python的基本數據類型以及list和dict的操作,靈活使用流程控制語句。

微信掃碼,參與3人拼團

微信客服

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

幫助反饋 APP下載

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

公眾號

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

友情提示:

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

本次提問將花費2個積分

你的積分不足,無法發表

為什么扣積分?

本次提問將花費2個積分

繼續發表請點擊 "確定"

為什么扣積分?

舉報

0/150
提交
取消