views:

82

answers:

2

What does the following Python statement mean?

send_data=""
str_len = "%#04d" % (len(send_data)/2)
+4  A: 

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 references provided by others.

Peter