The location of query Python under Windows which Python query python version python-v lists the files in the current directory dir switch directory CD
1 . Python interactive mode
- Command line go directly to type Python
- Run the idle new. py Format File
2, the development process of Python
- Create a file that ends with a./py
- At the command line, type python+ file name. py Execute python file
3. How to install Ipython
Pip install Ipython [all]
4. python
python print("this is my son") print("my name is" + "xutonghui") #字符串可以使用加号拼接,拼接内容仅限字符串 print("i am ok","thank you") #字符串可以使用逗号隔开
Naming rules
Letters, numbers, underscores
Cannot start with a number
Naming to make sense
Strictly case-sensitive
Cannot use identifiers and keywords (identifiers are custom, keywords are self-brought)
Python is a strongly typed, dynamic type of language
强类型是指语法严格,动态类型就是定义变量时不需要标识类型
Assignment of variables =
Check the type of variable ()
num1=123print(type(num1))
Determining the literal value of a variable
num1=123num2=121print(num1==num2)#最后返回的值 true或false
Determine if the address value of the referenced object is the same
num1=345num2=345printis num2)#最后返回的值 true或false
Address value ID of the instrumented object ()
num1=kkkprint(id(num1))
Basic Learning for Python