Technology Sharing

Python basic syntax notes (after having a basic understanding of C language)

2024-07-11

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

input() is used for input, and it returns a value (i.e. the value entered by the user). By default, it returns a string. Prompt statements can be placed in brackets.
If you want to split a line of code into multiple lines, you need to add "" at the end of each line.
A single "/" indicates mathematical division and does not round up. "//" will round down.
The string type can be multiplied by the integer type, which is equivalent to copying the string an integer multiple of the value. If output is performed, the output will be repeated.
Conditional statements

if [condition] :

[执行语句]

[执行语句]