Original address: http://blog.csdn.net/zanfeng/article/details/52164124Use the print output for each type of
String
Integer
Floating point number
Out-of-degree and precision control
Strhello = ' Hello Python ' print
The Python string is formatted with the character% format 1 format 2 character% (variable 1, variable 2), and the% format represents the type that accepts the variable. Examples of simple uses are as follows
# Example: String formattingName = '
Use the print output for each type of
String
Integer
Floating point number
Out-of-degree and precision control
Print StrhelloPython#直接出字符串1. Format the output integerPython print also supports parameter formatting, like the
the Python string is formatted using the "character% format 1% format 2 characters"% (variable 1, variable 2), and the% format represents the type of the accepted variable. Simple examples of use are as follows# Example: String formattingName = '
The output statements in python2.x and 3.x are significantly differentPrint in 2.x is not a function, the output format is as follows1Python 2.7.12+ (default, 4 2016, 20:04:34) 2[GCC 6.1.1 20160724] on linux23Type" Help","Copyright","credits" or
Use print to output
String
Integer
Floating Point Number
Output and precision control
Strhello ='HelloPython' PrintStrhello# Output result: HelloPython# Directly output a string
1. format the output integer
PythonPrint
Answer 1:PHP Echo Date (' Y '. ' Year '. ' M '. ' Month '. ' d '. ' Day '. ' H:i:s ',strtotime('-1 day '));Output Result:Warning:strtotime (): It is not safe for rely on the system ' s timezone settings. You is *required* to use the Date.timezone
C language printf output format control, printf output format
C language printf output format Control
Printf is familiar to everyone, but it is rare to estimate its usage. Go to another article and organize it in another day.
1. Conversion
C # Digital format output is something we often need to deal with in programming, so here are some examples of C # Digital formatted output that will make it easier for you to choose and compare, and what is better for your project.int a =
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.