Character, String type
#print (1/2)
# print (1//2) #地板除, is automatic rounding, not rounding, directly erase the decimal
#if判断时候, both true and false, that is, true and false.
Non-0 is true, non-null is True
Name=input ("Please enter your name:")
Name:
Print (name)
Else
Print ("error ....")
1 , Boolean type
Bool=false;
Printbool;
Bool=true;
Printbool;
2 , Integer
int=20;
print int;
3 , floating point
float=2.3;
print float;
4 , Digital
Include integers, floating-point numbers.
4.1. Delete numeric object references, for example:
A=1;
b=2;
c=3;
Del A;
del B, C;
#print A; #删除a变量后, calling the A variable again will cause an error.
2. character type conversions
Numeric type conversions
int (x [, Base]) converts x to an integer
Float (x) converts x to a floating-point number
Complex (real [, Imag]) creates a complex number
STR (x) converts an object x to a string
REPR (x) converts an object x to an expression string
Eval (str) is used to calculate a valid Python expression in a string and returns an object
Tuple (s) converts a sequence s to a tuple
List (s) converts the sequence s to a list
Chr (x) converts an integer to one character
UNICHR (x) converts an integer to a Unicode character
Ord (x) converts a character to its integer value
Hex (x) converts an integer to a hexadecimal string
Oct (x) converts an integer to an octal string
Python Note 5-character, String type