Python - Formatting codes & escape characters

 0    32 flashcards    sir
tải về mp3 In chơi tự kiểm tra
 
câu hỏi câu trả lời
Left aligns the result (within the available space)
bắt đầu học
:<
Right aligns the result (within the available space)
bắt đầu học
:>
Center aligns the result (within the available space)
bắt đầu học
:^
Places the sign to the left most position
bắt đầu học
:=
Use a plus sign to indicate if the result is positive or negative
bắt đầu học
:+
Use a minus sign for negative values only
bắt đầu học
:-
Use a space to insert an extra space before positive numbers (and a minus sign befor negative numbers)
bắt đầu học
:
Use a comma as a thousand separator
bắt đầu học
:,
Use a underscore as a thousand separator
bắt đầu học
:_
Binary format
bắt đầu học
:b
Converts the value into the corresponding unicode character
bắt đầu học
:c
Decimal format
bắt đầu học
:d
Scientific format, with a lower case e
bắt đầu học
:e
Scientific format, with an upper case E
bắt đầu học
:E
Fix point number format
bắt đầu học
:f
Fix point number format, in uppercase format (show inf and nan as INF and NAN)
bắt đầu học
:F
General format
bắt đầu học
:g
General format (using a upper case E for scientific notations)
bắt đầu học
:G
Octal format
bắt đầu học
:o
Hex format, lower case
bắt đầu học
:x
Hex format, upper case
bắt đầu học
:X
Number format
bắt đầu học
:n
Percentage format
bắt đầu học
:%
Old formatting codes:
bắt đầu học
%s, %d, %r, %a
%r -^ repr(); %a -^ repr() in Ascii
Alert
bắt đầu học
\a
Backspace
bắt đầu học
\b
Female symbol
bắt đầu học
\f
Male symbol
bắt đầu học
\v
Newline
bắt đầu học
\n
Tab
bắt đầu học
\t
Escape to hexadecimal notation
bắt đầu học
\xnn
Octal notation
bắt đầu học
\nnn

Bạn phải đăng nhập để đăng bình luận.