14
Python Day-1
1.Python Interpreter
![](https://res.cloudinary.com/practicaldev/image/fetch/s--Np9onjq7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2n75exxoxvcr7yk4kkeq.png)
' >>> ' 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.
![](https://res.cloudinary.com/practicaldev/image/fetch/s--dVAHd13P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7vcxlua1gxvrjgidjkbp.png)
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
![](https://res.cloudinary.com/practicaldev/image/fetch/s--XeG8fIu8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bf4c5ryjos0frp767bv8.png)
-> 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