High job training reptile dragon day1

print ( 'Anhui Institute of Finance and Trade is very powerful') 

# define a variable:
# name: variable name
# =: used to bind variable name and variable value
# 'High Fragrance': the value of the variable
name = 'High Fragrance'
Age = 19
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
store pay height

- the string
must be in single or double quotes, three quotes

- Boolean
true: true, false: false

- list
brackets [], brackets can store a plurality of variables, each variable separated by commas.
Note: The comma must be in English input method.
Value: The list name [subscript]

- tuple
Parentheses (), brackets can store a plurality of values, each value separated by commas

Note: The list can be modified value tuples not.

- set
{1, 2, 3 ...}
braces {} brackets separated by commas, can store multiple values.
Built-in deduplication functionality.

- dictionary
braces {} brackets separated by commas, can be stored a plurality of values,
but the values are in each key: value stored in the form.
Note: a 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 = 'Fage'
Print ( 'name --->', type name ())

# Boolean
# variable name and determining the value of the variable is equal tank1
print (name == 'fage') # True
Print ( 'BOOL --->', type (name == 'Fage')) True #


# list
List1 = [ 'Fage', 18 is, 'MALE']
Print (List1)
Print ( 'List1 --->' , type (List1))

# 0. 1
names = [ 'high dragon', 'Liu Ao Bo']
# list value
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}
Print ( 'setl --->', type (setl))


# Dictionary
# Key -> "name": value ---> 'Tank',
dict1 = { "name": 'Tank', ' Age ':} 18 is
Print (' dict1 ---> ', type (dict1))

Guess you like

Origin www.cnblogs.com/fage5113/p/11575997.html