Python formatted output:
1.
Print (' Your best friend is '%s ' computer ')
%d formatted output integer
%s formatted output string
%r format output pre-unknown type, any type
Print (' Your best%s is%s '% (' friends ', ' computer ')
Pit point:
1. The percent semicolon does not distinguish between Chinese and English
2. () parentheses to be entered in English form
3. Quotation marks should be in English form
2.
Name = input (' Please enter your name: ')
Age =int ((Input (' Please enter your Ages: ')))
scholar = input (' Educational background: ')
info = "' #格式化输出然后交给info
+++++++++++ {_name} related information +++++++++++
name: {_name}
Age: {_age} years
Education background: {_scholar}
+++++++++++ Info ++++++++++++++++++
". Format (_name =name, _age = age, _scholar = scholar) #格式化输出, each corresponding to the corresponding value, can disrupt
Print (info)
print (' Goodbye ')
Pit point:
1. The "content" semicolon can also be placed on the left side of the assignment equal sign to make long formatted output
Starting and ending formats
2.format formatted output method {} can write a name or do not write, or preferably write, or
May not know how to die, do not fill in order to fill in the corresponding position
Python formatted output