1

What does the following Python statement mean?

send_data=""
str_len = "%#04d" % (len(send_data)/2)
Imran
91.7k26 gold badges101 silver badges132 bronze badges
asked Oct 12, 2009 at 8:50

1 Answer 1

4

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.

vaultah
46.9k13 gold badges120 silver badges145 bronze badges
answered Oct 12, 2009 at 8:53
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.