Read a little every week. Do not forget to beginner's mind party always! Continue Python second play.
flag=" " flag2=" Queen "print(flag+ " \ n "+Flag2) #这里细心的小伙伴可能会发现. Flag has one more space before and after Flag2. Print(flag+"\ n"+flag2.strip ()) When the front space is printed Python comes with a function strip () that removes the front and back spaces. Automatically remove the front and back space, also known as delete blank. and Rstrap () remove the trailing blanks, lstrap () remove the opening spaces
The python I installed here is version 3.6. But in the version of Python2. The print statement is not required to take the following () for example
Print(" Queen ") #3版本 print" queen " #2版本, a little detail. Since the version after 3. Print () is treated as a function to use
About the arithmetic operations of Python
Subtraction don't say, here's the point to mention the exponentiation operation
Print (3**2) #python里面对于乘方使用两个 * represented. (3**2) represents 3 of 2 =9print(3**3)
For mixed use of string types and fee string types (int, etc.)
Print (" China first "+19+ " big Meeting held in Beijing ") #第一句话我们是想输出 "China 19th Congress held in Beijing", But Python has an error. Why, this involves the numeric type and string mix, Python does not know what type of print your 19 represents (" China "+str (19) + " big Meeting held in Beijing ") #所以我们要用str () function to convert a variable of a non-character type
See you next week!
Python get started the second week, do not forget beginner's mind party always