Python学习
对象及引用丶标识符丶变量和简单的赋值等基础知识
通过使用对象了解了a=3不是简单的把3赋值给a
下面是Demo
>>> a=3
>>> a
3
>>> id(3)
140712168882512
>>> type(3)
<class 'int'>
>>> b='我爱你'
>>> id(a)
SyntaxError: invalid character in identifier
>>> id(a)
140712168882512
>>> type(a)
<class 'int'>
>>> print(a)
3
>>> id(b)
2264076995632
>>> type(b)
<class 'str'>
>>>
>> 通过使用引用了解了python是动态类型语言和强类型语言
```python
>> 通过使用标识符了解基本用法
>1.给变量起名字区分大小写
>2.以字母和下划线开头,其后的字符是:字母,数字,下划线
>3.不能使用关键字。
>4.双下划线开头和结尾的名称都有特殊的含义,尽量 避免这种写法
>模块和报名规则:全小写字母,尽量简单,若多个单词之间用下划线
>函数名:全小写字母,多个单词之间用下划线隔开
>类名:首字母大写,采用驼峰原则,多个单词时,每个单词第一个字母大写,其余部分小写,常量名:全大写字母,多个单词用下划线隔开
>下面是Demo
><class 'str'>
>>> sxt=123
>>> sxt=234
SyntaxError: unexpected indent
>>> 3sdf=33
SyntaxError: invalid syntax
>>> help()
Welcome to Python 3.7's help utility!
If this is your first time using Python, you should definitely check out
the tutorial on the Internet at https://docs.python.org/3.7/tutorial/.
Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules. To quit this help utility and
return to the interpreter, just type "quit".
To get a list of available modules, keywords, symbols, or topics, type
"modules", "keywords", "symbols", or "topics". Each module also comes
with a one-line summary of what it does; to list the modules whose name
or summary contain a given string such as "spam", type "modules spam".
help> keywords
Here is a list of the Python keywords. Enter any keyword to get more help.
False class from or
None continue global pass
True def if raise
and del import return
as elif in try
assert else is while
async except lambda with
await finally nonlocal yield
break for not
help>