中文字幕一区二区人妻电影,亚洲av无码一区二区乱子伦as ,亚洲精品无码永久在线观看,亚洲成aⅴ人片久青草影院按摩,亚洲黑人巨大videos

Python zfill()方法

Python 字符串 Python 字符串


描述

Python zfill() 方法返回指定長(zhǎng)度的字符串,原字符串右對(duì)齊,前面填充0。

語法

zfill()方法語法:

str.zfill(width)

參數(shù)

  • width -- 指定字符串的長(zhǎng)度。原字符串右對(duì)齊,前面填充0。

返回值

返回指定長(zhǎng)度的字符串。

實(shí)例

以下實(shí)例展示了 zfill()函數(shù)的使用方法:

#!/usr/bin/python

str = "this is string example....wow!!!";

print str.zfill(40);
print str.zfill(50);

以上實(shí)例輸出結(jié)果如下:

00000000this is string example....wow!!!
000000000000000000this is string example....wow!!!

Python 字符串 Python 字符串

其他擴(kuò)展