Tin mới
2. Using the Python Interpreter
3.1. Using Python as a Calculator¶
In the following examples, input and output are distinguished by the presence or absence of prompts (>>> and …): to repeat the example, you must type everything after the prompt, when the prompt appears; lines that do no
The interpreter acts as a simple calculator: you can type an expression into it and it will write the value. Expression syntax is straightforward: the operators +, -, * and / can be used to perform arithmetic; parenthese
Strings are examples of sequence types, and support the common operations supported by such types.
Strings are examples of sequence types, and support the common operations supported by such types.