python3 (b)

# Boolean and Java as not verify the 
# null value None is a special null 
# variable variable names must be uppercase and lowercase, numbers and _ in combination, can not start with a number, equal sign = is the assignment statement may the assignment of any data type to a variable, with a variable assignment can be repeated, and may be a different type of variable 
a = 123   # a is an integer of 123 
Print (a) 
a = ' the ABC '   # a string becomes the ABC 
Print (a)
 # for variable assignment x = y x is the variable points to a real object that is pointed to by the variable y. Y is then assigned to the variable the variable x does not affect the point 
B = ' VV ' 
A = B 
A = ' V2 ' 
Print (A, B)   # V2 VV 

# create a 'ABC' in memory string; 
#Created in memory of a variable called a and point it 'ABC'. 

# Above variables are not fixed per se type language called 'dynamic language' is as python, corresponding to the 'static language' as java. Static language must be specified when defining a variable variable type, time assignment if the type does not match, the error will be 
# constants represent only a constant instructions on the practice of using all uppercase variable names, in fact, still a variable PI 
PI = 3.14159265359 # division / / floating point division calculations result, even exactly divisible by two integers, floating point result is Print (. 9 /. 3)   # 3.0 
# // called floor addition, division of two integers is still an integer, discarding directly decimal, unrounded Print (//. 11. 3)   # . 3 
# remainder Print (10. 3%)   # . 1 # Note 
# integer Python is no size limit, and some languages according integer which memory length is limited in size, e.g. Java scope is limited to 32-bit integer -2147483648-2147483647. 
# Python floats will no size limit, but beyond a certain range directly expressed as inf (infinity).





 

Guess you like

Origin www.cnblogs.com/shaozhiqi/p/11543429.html