In Python you want to output a sentence, as follows
1A='Hello World'2 Printa3//The print out is Hello world4 5 Print 'hello \ n World'6//print out is the7//Hello8// World9 Print " "HelloTen World One Good A Bye" " -//print out is the -//Hello the// World -//Good -Bye
If you want to output a newline string, you can add the escape character ' \ n ' to the string, or use "or" to wrap the formatted output string together.
In addition, "or" "also has the function of multi-line annotation.
Slicing a string
1Str='ABCDE'2 PrintA[0]3//output a4 PrintA[1]5//Output B6 PrintA[0]+a[1]7//Output AB8 9 slices:Ten PrintStr[1:4] One//Output BCD A PrintStr[1:] -//Output BCDE - PrintStr[1::2] the//OUTPUT BD - PrintStr[-1:-4:-1] -//Output EDC - + Str[x:y:z] Where str is a string, X is the starting point of the slice, Y is the end of the slice, and Z is the step - + so it's easy to use Python to reverse the string. A PrintStr[-1:-6:-1] atOutput EDCBA
Python Learning (eight) output a string in any format and a slice of a string