第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
# Enter a code
#coding:utf-8
age=19
if age>=18:
print('adult')
else:
print('teenager')
# Enter a code
# coding:utf-8
age=19
if age>=18:
print('adult')
# Enter a code
s='AABCDEFGHHIJ'
a=s[1:9]
print(a)
# coding: utf-8
s1 = '這是中文字符串'
s2 = 'this is an English string'
print(s1+s2)
# Enter a code
# -*- coding: UTF-8 -*-
template='Life is {0},you need {1}'
result=template.format('short','python')
print(result)
print('life is short,you need{}'.format('python'))
print('life is short,you need{launguage}'.format(launguage='python'))
# Enter a code
L = [75, 92, 59, 68, 99]
sum = 0.0
for x in L:
sum = sum + x
print(sum / 5)
# Enter a code
a=21
if a>=18:
print('adult')
elif a>= 6:
print('teenager')
elif a>= 3:
print('kid')
else:
print('baby')
這里,因為score = 59 < 60,所以if的判斷是True,因此就會執(zhí)行print('抱歉,考試不及格')。
這里有幾個需要注意的地方:
可以看到print('抱歉,考試不及格')這行代碼明顯比上一行代碼縮進(jìn)了,這是因為這行代碼是if判斷的一個子分支,因此需要縮進(jìn),在Python規(guī)范中,一般使用4個空格作為縮進(jìn)
在if語句的最后,有一個冒號:,這是條件分支判斷的格式,在最后加入冒號:,表示接下來是分支代碼塊
a=3.14
b=1.57
c=a*b
print(round(c,2))
a='hello world'
b='hello world'
c='hello world'
print(a)
print(b)
print(c)
# Enter a code
a=3.1415926
b='learn python in imooc'
c=100
d=0b1101
print isinstance(a,float)
print isinstance(b,str)
print isinstance(c,int)
print isinstance(d,int)
# coding: utf-8
a='zhe shi zhong guo'
b='這是中國'
c='"這是一句中英文混合的Python字符串:Hello World!"'
print(a)
print(b)
print(c)
# Enter a code
a='Life is short,{}'
b='you need Python.'
result=a.format(b)
print(result)


a='Life is short,{c}'
b='you need Python.'
result=a.format(c=b)
print(result)
# Enter a code
a='Life is short,{}'
b='you need Python.'
result=a.format(b)
print(b)

a='Life is short,{c}'
b='you need Python.'
result=a.format(c=b)
print(result)
# Enter a code
a=r''' '\"To be, or not to be\": that is the question.\nWhether it\'s nobler in the mind to suffer. '''
print(a)
課程須知
如果您了解程序設(shè)計的基本概念,會簡單使用命令行,了解中學(xué)數(shù)學(xué)函數(shù)的概念,那么對課程學(xué)習(xí)會有很大的幫助,讓您學(xué)起來得心應(yīng)手,快速進(jìn)入Python世界。
老師告訴你能學(xué)到什么?
通過本課程的學(xué)習(xí),您將學(xué)會搭建基本的Python開發(fā)環(huán)境,以函數(shù)為基礎(chǔ)編寫完整的Python代碼,熟練掌握Python的基本數(shù)據(jù)類型以及l(fā)ist和dict的操作,靈活使用流程控制語句。

微信掃碼,參與3人拼團(tuán)

微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

友情提示:

您好,此課程屬于遷移課程,您已購買該課程,無需重復(fù)購買,感謝您對慕課網(wǎng)的支持!

本次提問將花費(fèi)2個積分

你的積分不足,無法發(fā)表

為什么扣積分?

本次提問將花費(fèi)2個積分

繼續(xù)發(fā)表請點(diǎn)擊 "確定"

為什么扣積分?

舉報

0/150
提交
取消