Daily operations

Print ( ' Anhui Institute of Finance and Trade is very powerful ' )
 # define a variable: 
# name: variable name 
# =: used to bind variable name and variable value 
# 'Lvlian Jie': the value of the variable 
name = ' Lvlian Jie ' 
Age = 83 
Sex = ' FEMALE ' 

# call variable 
Print (name, Age, Sex) 

' '' python8 big data type: 
- integer (integer): int 
18 is 
used to store identification ID, age .. 
- float (decimal): a float 
15.5 1.9 
storage salary, height 
- string 
must be quoted in single or double quotes, triple quotes 
- Boolean 
true: true, false: false 
- list 
brackets [], a plurality of values can be stored in parentheses, each of the values separated by commas
Note: The list of values can not be modified tuple. 
- set
{1,2,3 ...} 
braces {}, brackets have been separated by commas, can be stored a plurality of values 
but the values are in each key:. Value stored in the form 
NOTE: dictionary key must be unique . 
Key {: value, key2: value} '' ' 
# Integer 
Age = 18 is Print ( ' Age ---> ' , type (Age))
 # float 
height = 1.9 Print ( ' height ---> ' , type (height))
 # character 
name = ' Tank ' Print ( ' name ---> ' , name (type))
 # Boolean 
# Analyzing variable name and the variable value is equal tank1 Print



(name == ' Tank ' ) # True 
Print ( ' BOOL ---> ' , type (name == ' Tank ' )) # True 
# list 
List1 = [ ' Tank ' , 18 is, ' MALE ' ]
 Print (List1 )
 Print (List1 ---> , type (List1))
 # 0. 1 
names = [ ' Lvlian Jie ' , ' LU silver silver ' ]
 # listing values 
Print (names [. 1 ])
# Tuple  
tuple1 = (1,2,3)
 Print ( ' tuple1 ---> ' , type (tuple1))
 # set 
set1 = {1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1 }
 # Dictionary 
# Key -> '' name '': value ---> 'Tank', dict1 = { '' name '': 'Tank', 'Age' :} 18 is 
Print (dict1 ---> ' , type (dict1))

 

Guess you like

Origin www.cnblogs.com/xiaozhe1/p/11574687.html