10. Python string concatenation and formatting

Let's look at the splicing at runtime:
Insert picture description here
Insert picture description here

In addition to this formatting, we have learned that sprintf of C language can format and output a string, and set this through some formatting fields;
we also have such a syntax in python:
Insert picture description here

String length: It
Insert picture description here
can be seen that the corresponding Chinese characters and ASCII codes actually occupy 1 bit. The function len obtains not the size of the space, but the entire number of words.

Guess you like

Origin blog.csdn.net/zhaopeng01zp/article/details/109251251