Linux Query Python version: Python-v
Linux enters Python:python
Exit Python:ctrl+d
Working with source files: helloworld.py
Run this program: Python helloworld.py
The directory is added to the PATH variable: path= $PATH:/home/swaroop/mydir completed. where "/home/swaroop/mydir" is the directory that I want to add to the path variable.
String usage in Python:
(1) using single quotation marks (')
this '
(2) Use double quotation marks (")
The string in double quotation marks is exactly the same as the string used in single quotation marks.
" What ' s your name? "
(3) Use three quotation marks ("' or '" ')
You can indicate a multi-line string by using the three quotation marks. You can use single and double quotation marks freely in three quotes.
" " This is a multi-line string. The first line. The second line. waht's your name?, "" "
(4) Escape character
Output ' "\ in string, use \ \ \ \
Note: "This is the first sentence.\
This is the second sentence. " =====> is equivalent to "this is the first sentence. This is the second sentence. "
A Concise Python tutorial