The difference between the single quotation mark ', the double quotation mark ", the three quotation mark" "" "" "
1, single and double quotation marks are used for a reference to a string, where using double quotation marks when you need to wrap the line character "\", but when using three quotation marks (multi-quotes), you do not need to use a line character, in addition to the three quotation marks can use the note (#).
Print "Hello, world!" Print "Hello, world!" Print "" "Hello, World!" "" Print "" "Hello, #first Python script world!" "
2. Single quotes and double quotes are indistinguishable from string references, avoiding the use of escape symbols when using double quotation marks when double quotes are used, and using single quotes more succinctly and aesthetically. Single quotes are also true.
Print "I am here!" print ' I\ ' am here! ' print ' You said ' YES '. ' print "You said \" Yes\ "."
Ii. differences between raw_input () and input ()
1, when the input is a pure number
Input returns a numeric type, such as Int,float
Raw_inpout return String type, String type
2. Input string is an expression
Input computes the numeric expression in the string, and Raw_input does not.
If you enter "5 + 3":
In fact:
def input (Prompt): Return (eval (raw_input (prompt)))
Three
1, accepts the input does not have the line to need to add the comma (,)
Print "Do you know Python?", Anw = Raw_input () print "Yes,you got it?" Anw1=raw_input ()
2,%r replace the original character content, do not explain
A = "abc" print "Frist var test a is%r"% aprint "Frist var test A is%s"% a
This article from the "Down-to-earth, pragmatic" blog, please be sure to keep this source http://3633188.blog.51cto.com/3623188/1610322
Python print