1. Input and output:
Output: print, as follows
>>> print ' Hello world '
Hello World
Inputs: Input (), Row_input ()
The recommended use of row_input (), input () will default to the data type you entered is correct, resulting in some errors, unless specifically required, try to use Row_input
>>> name = Raw_input ("What Are you name?")
What are you name? sola
>>> Print Name
Sola
2. String
A, long string
If you want to write a very long and long, to span a few lines can use three quotation marks, as follows:
>>> print ' What is laughing at?
... I don ' t know what's that mean
... sorry! "
B, Raw string
Like "\ n" These strings with backslashes will have a newline, or other escape effect, so for example, when we want to print an object directory (such as D:\nothing\that), an unnecessary error occurs.
But the original string does not have special treatment for these backslashes, the original string, as long as it starts with R before the string, as follows:
>>> print ' D:\nothing\that '
D:
othing hat
>>> print R ' D:\nothing\that '
D:\nothing\that
C, Unicode string
This detail is not quite known, the usage is similar to the original string, with a u in front of the string, as follows
>>> print u ' Hello World '
Hello World
3. Some functions
Pow (x,y[,z]) #返回x的y次幂 (resulting in Z-modulo)
Round (Number[,ndigits]) #根据给定的精度对数字进行四舍五入
Basic knowledge of Python learning notes (2)