The data is the variable value
int integral type
Definition: age=10 #age =int (10)
For identification: Age, grade, ID number, QQ number, number
float Float Type
Definition: salary=3.1 #salary =float (3.1)
Used to identify: salary, height, weight
String
The character that is quoted in Python is the string type
Definition name= "Sunny" #name =str (' Egon ')
There is no difference between single and double quotes
The list in [], separated by commas, can hold N of any type of value. The count order in the list starts at 0
Definition: room=[1, ' Xiaohong ', [' A ', ' B ']
A list can be nested
When a nesting of a in a list's suite is taken
Print= (Room[2][0])
Dictionary
Dictionaries are somewhat similar to lists, but better than lists. The purpose of our use of lists and dictionaries is to access the values, and the value in the list is to know the value in the list
Position. Because the dictionary specifies a hard mapping relationship type, the arrangement can be unordered, arbitrary.
Definition: info={' name ': ' Zhou ', ' age ': $, ' food ': ' Apple ' #info =dict ({' name ': ' Zhou ', ' age ': ' Food ': ' Apple '}) Used to identify: when storing multiple values, each value has a unique key that can be more easily and efficiently evaluated.
Print (info[' food ')
Lists and dictionaries can print multiple values at once
Print (info[' name '],info[' age ')
Zhou 18
Boolean
Boolean value two consciousness True one False
Boolean is a logical operation that determines whether a condition is established. A false identity with true identity is not established.
The learning journey of Python ——— basic data types