strictlygreaterthan>=greate" />

欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

python3常見操作

系統 1641 0
閱讀更多

?

?布爾操作,是或者否:

Operation

Result

Notes

x ? or ? y

if? x ?is false, then? y , else? x

(1)

x ? and ? y

if? x ?is false, then? x , else? y

(2)

not ? x

if? x ?is false, then? True , else? False

(3)

?

?

比較操作,大還是小,是否相同對象,是否相同值:

Operation

Meaning

<

strictly less than

<=

less than or equal

>

strictly greater than

>=

greater than or equal

==

equal

!=

not equal

is

object identity

is ? not

negated object identity

?

?

常用數學計算:

Operation

Result

Notes

Full documentation

x ? + ? y

sum of? x ?and? y

? ?

x ? - ? y

difference of? x ?and? y

? ?

x ? * ? y

product of? x ?and? y

? ?

x ? / ? y

quotient of? x ?and? y

? ?

x ? // ? y

floored quotient of? x ?and? y

(1)

?

x ? % ? y

remainder of? x ? / ? y

(2)

?

-x

x ?negated

? ?

+x

x ?unchanged

? ?

abs(x)

absolute value or magnitude of? x

?

abs()

int(x)

x ?converted to integer

(3)(6)

int()

float(x)

x ?converted to floating point

(4)(6)

float()

complex(re, ? im)

a complex number with real part? re , imaginary part? im .? im ?defaults to zero.

(6)

complex()

c.conjugate()

conjugate of the complex number? c

? ?

divmod(x, ? y)

the pair? (x ? // ? y, ? x ? % ? y)

(2)

divmod()

pow(x, ? y)

x ?to the power? y

(5)

pow()

x ? ** ? y

x ?to the power? y

(5)

?

?

字符串常見操作:

Operation

Result

Notes

x ? in ? s

True ?if an item of? s ?is equal to? x , else? False

(1)

x ? not ? in ? s

False ?if an item of? s ?is equal to? x , else? True

(1)

s ? + ? t

the concatenation of? s ?and? t

(6)(7)

s ? * ? n ?or? n ? * ? s

equivalent to adding? s ?to itself? n ?times

(2)(7)

s[i]

i th item of? s , origin 0

(3)

s[i:j]

slice of? s ?from? i ?to? j

(3)(4)

s[i:j:k]

slice of? s ?from? i ?to? j ?with step? k

(3)(5)

len(s)

length of? s

?

min(s)

smallest item of? s

?

max(s)

largest item of? s

?

s.index(x[, ? i[, ? j]])

index of the first occurrence of? x ?in? s ?(at or after index? i ?and before index? j )

(8)

s.count(x)

total number of occurrences of? x ?in? s

?

?

?

數組常見操作:

Operation

Result

Notes

s[i] ? = ? x

item? i ?of? s ?is replaced by? x

?

s[i:j] ? = ? t

slice of? s ?from? i ?to? j ?is replaced by the contents of the iterable? t

?

del ? s[i:j]

same as? s[i:j] ? = ? []

?

s[i:j:k] ? = ? t

the elements of? s[i:j:k] ?are replaced by those of? t

(1)

del ? s[i:j:k]

removes the elements of? s[i:j:k] from the list

?

s.append(x)

appends? x ?to the end of the sequence (same as? s[len(s):len(s)] ? = ? [x] )

?

s.clear()

removes all items from? s ?(same as? del ? s[:] )

(5)

s.copy()

creates a shallow copy of? s ?(same as? s[:] )

(5)

s.extend(t) ?or? s ? += ? t

extends? s ?with the contents of? t ?(for the most part the same as s[len(s):len(s)] ? = ? t )

?

s ? *= ? n

updates? s ?with its contents repeated? n ?times

(6)

s.insert(i, ? x)

inserts? x ?into? s ?at the index given by? i (same as? s[i:i] ? = ? [x] )

?

s.pop([i])

retrieves the item at? i ?and also removes it from? s

(2)

s.remove(x)

remove the first item from? s ?where? s[i] ?is equal to? x

(3)

s.reverse()

reverses the items of? s ?in place

(4)

?

?

常見格式化占位符:

Conversion

Meaning

Notes

'd'

Signed integer decimal.

?

'i'

Signed integer decimal.

?

'o'

Signed octal value.

(1)

'u'

Obsolete type – it is identical to? 'd' .

(6)

'x'

Signed hexadecimal (lowercase).

(2)

'X'

Signed hexadecimal (uppercase).

(2)

'e'

Floating point exponential format (lowercase).

(3)

'E'

Floating point exponential format (uppercase).

(3)

'f'

Floating point decimal format.

(3)

'F'

Floating point decimal format.

(3)

'g'

Floating point format. Uses lowercase exponential format if exponent is less than -4 or not less than precision, decimal format otherwise.

(4)

'G'

Floating point format. Uses uppercase exponential format if exponent is less than -4 or not less than precision, decimal format otherwise.

(4)

'c'

Single character (accepts integer or single character string).

?

'r'

String (converts any Python object using? repr() ).

(5)

's'

String (converts any Python object using? str() ).

(5)

'a'

String (converts any Python object using? ascii() ).

(5)

'%'

No argument is converted, results in a? '%' ?character in the result.

?

更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 波多野结衣综合 | 看特级毛片 | 午夜三级影院 | 日韩色小说 | 亚洲五月婷 | 奇米影视四色7777 | 国产精品亚洲精品日韩已方 | 成人福利在线观看 | 国产成+人+亚洲+欧美+日韩 | 草草线在成人免费视频 | 久久伊99综合婷婷久久伊 | 制服丝袜成人动漫 | 久久成人免费视频 | 色婷婷成人做爰A片免费看网站 | 在线精品自拍亚洲第一区 | 96国产精品久久久久aⅴ四区 | 拍真实国产伦偷精品 | 欧美日韩精品一区二区在线线 | 91激情网| 欧美手机在线观看 | 黑人一区 | 欧洲成人综合网 | 999精品视频在线观看 | 欧美两性 | 99热久久精品免费精品 | 免费观看一级欧美在线视频 | 三上悠亚2022年最新番号 | 狠狠色丁香婷婷综合橹不卡 | 午夜视频在线观看免费观看在线观看 | 国产精品亚洲精品青青青 | 丝袜久久| 一区二区三区四区免费 | 日韩经典欧美一区二区三区 | 男女猛烈激情xx00免费视频 | 国产精品v欧美精品∨日韩 一级免费黄色免费片 | 五月婷婷丁香在线观看 | 久操热| 国产综合99 | 国产三级福利 | 拍真实国产伦偷精品 | 亚洲精品视 |