1.python species
Cpython: c language written in python interpreter
Javapython written in Java python interpreter
with c # c # python interpreter written in python
PYPY written in python python interpreter
2.python procedure:
1) performing terminal: C: D /python.exe: /1.py python interpreter: C: /python.exe 2) File Header # / usr /! bin / the env Python .py file permissions to add 3) encoding # - * - coding: UTF-. 8 - * - . 4) special statement print () # variable value can be displayed or string input ( '>>>') # wait enter, the statement appears in parentheses pass # through, the equivalent of an empty statement input does not display when getpass # input if conditions: statement # Note indent elif condition: statement
else:
statement
while condition:
statements
break # execute this out of the loop
continue # re-execute this judgment condition
5) variable name
letters
numbers
underscore
Requirements:
# can not start with a number
# You can not use the keyword
# Do not use internal variables used by the system 3. operator: 1) arithmetic operators + - * / % # remainder ** exponentiation # @ # take supplier 2) comparison ==
> =
<=
<> Is not equal to #
= # Not equal to!
>
<
3) logical operators
and
or
Not
left to right
priority:
Not> and> or
. 4) assignment operator
=
+ =
- =
* =
/ =
% =
** =
@ =
5) operator member
in
Not in
2019-08-21