% 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.
加载中,请稍侯......
精彩评论