First, comments
1. #: Comment Line (shortcut key ctrl+/)
2, ' ' ' three quotation marks: Comment All the contents in quotation marks
Second, string
1, input () the type returned is a string
2. Strings can be enclosed in single or double quotation marks
1) If the string contains single quotes, the string is enclosed in double quotation marks.
2) If the string contains double quotation marks, the string is enclosed in single quotation marks.
3) If the character is swapped with single and double quotes, the string is enclosed in three quotation marks.
4) Operation Result:
3. Forced conversion of strings
1) convert character to int
2) force the string into float
3) Operation Result:
4. Related operation of string
1) Find
Printing results:
2) string Case conversion
Printing results:
3) string judgment
Printing results:
4) String Connection
Print STR3 display: Hello World
python-Comments and strings