A. Python installation
1. Download the installation package (I use python3.5.1)
https://www.python.org/downloads/
2. Installing Python-3.5.1.exe
I download is python-3.5.1-embed-amd64.zip green version, unzip directly can open Python-3.5.1.exe
Second, declaring variables
- Variable names can only be any combination of letters, numbers, or underscores
- The first character of a variable name cannot be a number
- The following keywords cannot be declared as variable names
[' and ', ' as ', ' assert ', ' Break ', ' class ', ' Continue ', ' Def ', ' del ', ' elif ', ' Else ', ' except ', ' exec ', ' finally ', ' for ', ' F ' Rom ', ' Global ', ' if ', ' import ', ' in ', ' was ', ' lambda ', ' not ', ' or ', ' pass ', ' print ', ' raise ', ' return ', ' try ', ' while ', ' WI Th ', ' yield ']
Third, user name, password input
Iv. if else Judgment statement
#!/usr/bin/env python
#-*-Coding:utf-8-*-
#定义变量并赋值
Age=25
#输入一个数字
Guss_age=int (Input ("Please input Guss Age:"))
#如果比初始定义变量大, the output is too large
If Guss_age>age:
Print ("Too big")
#如果比初始定义变量小, the output is too small
Elif Guss_age<age:
Print ("Too small")
#如果和初始定义变量一样, the output is correct
Else
Print ("Currurt")
Python Beginner's Learning