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

為了賬號安全,請及時綁定郵箱和手機立即綁定
# coding: utf-8
s1 = '這是一句中英文混合的Python字符串:'
s2 = 'Hello World!'
print(s1+s2)
result = 's1{s2}'.format(s2='Hello World!')
print(result)
num = 0
sum = 0
while True:
if num>1000:
break
sum = sum + num
num = num + 2
print(sum)
num = 1
plus = 1
while num <= 20:
plus = plus * num
num = num + 1
print(plus)
L = [75, 92, 59, 68, 99, 100, 87, 71]
sum = 0.0
count = len(L)
for score in L:
sum = sum + score
ave = sum/count
print(sum,count)
print(ave)
# Enter a code
age = 17
a = 'your age is {}, and you are a {}.'
if age>=18:
print(age, a.format(age, 'adult'))
else:
print(age, a.format(age, 'child'))
http://www.sogou.com
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')
愛你!愛你愛你!
python=(a+b+c)
a=hei
b=lo
c=world
print(浮點數)
print(字符串)
print(整數)
print (二進制)
因為短路計算,所以a=python時不計算or,直接返回python。
當b=空格,所以b=false;false or world=world
def getSecond(elem):

return elem[1]


L = [('Alice',89), ('Bob',72), ('Candy',88), ('David',79), ('Ellena',99)]

#把list的每個元素的key賦值為各個元素的下標為1的值,然后list按key的數值大小進行排序
L.sort(key=getSecond,reverse=True)

print(L)

list = []

for item in L:
list.append(item[0])
print(list)
# 多行用''' ''' 注釋 前綴加r就不用加轉義符/
# 上述為多行不用轉述,所以r'''
L = ['Alice', 'Bob', 'Candy', 'David', 'Ellena']
a=L.pop(2)
s=L.pop(2)
print(a,s)
課程須知
如果您了解程序設計的基本概念,會簡單使用命令行,了解中學數學函數的概念,那么對課程學習會有很大的幫助,讓您學起來得心應手,快速進入Python世界。
老師告訴你能學到什么?
通過本課程的學習,您將學會搭建基本的Python開發環境,以函數為基礎編寫完整的Python代碼,熟練掌握Python的基本數據類型以及list和dict的操作,靈活使用流程控制語句。

微信掃碼,參與3人拼團

微信客服

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

幫助反饋 APP下載

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

公眾號

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

友情提示:

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

本次提問將花費2個積分

你的積分不足,無法發表

為什么扣積分?

本次提問將花費2個積分

繼續發表請點擊 "確定"

為什么扣積分?

舉報

0/150
提交
取消