14
Python Day-1
1.Python Interpreter
' >>> ' this is python prompt,waiting for the input.
Python interpreter can be used as a calculator,simple arithematic calculations can be using the operators +,-,*,/,(()) .
Variables can also be used in the python interpreter and values are assigned to it.
In the example shown width and height are variables and values are assigned to it , their value is calculated and stored in 'area', later using the print() function the value of area is printed.
Python supports integer, floating, decimal, fraction and also python has builtin functions for complex number it used 'j' to indicate the imaginary part 3+5j
-> To open a file in interpreter mode
python3 -i filename.py
2.Strings
-> Single Quotes: Identifier representation.
-> Double Quotes: String representation.
-> Triple Quotes: Multiline Texts
The below table represents how python uses indices
+---+---+---+---+---+---+
| P | y | t | h | o | n |
+---+---+---+---+---+---+
0 1 2 3 4 5 6
14