开发者

% operator in python over string

What does the following Python statement mean开发者_StackOverflow?

send_data=""
str_len = "%#04d" % (len(send_data)/2)


This sets str_len to show half the length of send_data, padded with zeros to be four characters right. The % character is carrying out interpolation. See the printf-style String Formatting section of the documentation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜