python numeric type
variables
-the variable is an area in memory.
Variable naming: Variables are composed of letters, numbers, and underscores.
The address variable in Python is the opposite of the C language, and a single piece of data contains multiple tags;
1. The difference between input and raw_input
Print + string
Input + Numeric type
Raw_input + Character type
Input receives numeric type data: How to make judgment leap year? and determine its type
This year can be divisible by 4 but not divisible by 100, or divisible by 400, then leap years
raw_input data that receives a string type:
2, arithmetic
Operators and expressions
Arithmetic operators: +,-, *,**,/,%,//
This method directly converts a shape to a floating-point type
Assignment operators: =, + =,-=,/=, *=,%=
Relational operators: >=, <, <=,! =, = =
Logical operators: Logical AND And, logical OR OR, logical non-not
3. Character type
1) difference between num=123 and num= "123"
2) integral type and long shaping
? Force defined as Long integer: num2 = 123L
3) Float type
? 1.2e10 represents a value of 1.2 of 10 times;
? 12e9 represents a value of 12 of 9 times;
4) plural type
? Python provides inline support for complex numbers, eg:3.14j, 8.32e-36j
5) Type bool
Examples:
First, the input of the results, and to find the average of the results
Second, the user login
1. User name and password system given;
2. When the user logs in, enter the user name and password to determine if the login is successful;
Enhancement Requirements:
1. User login has three opportunities, more than 3 times has not been successful, error;
2. If the username password is correct, the login is successful, exit the program; (Exit ())
python--Numeric type