some of the content comes from the official website of Liaoche https://www.liaoxuefeng.com/I.. bytes data type
The data that is transferred on the network or on the disk, in bytes.
Details Visible https://www.cnblogs.com/R-bear/p/7744454.html
Ii. list (list) type
increase : 1. Add to specified location: Listname.insert (Index,value)
2. Add to end: Listname.append (value)
Delete: 1. Remove the specified location: listname. Pop (index)
2. Delete End data: Listname.pop ()
Change : Assign value directly to index position: ListName (index) =value;
Check : Use index, index starting from 0, to Len (listname)-1 end, get last element in addition can use Listname[len (listname) 1], can also use listname[-1], Second listname[-2], and so on
Summary: List, is a python built-in sequential collection, can be stored in different data types, the list can be called a two-dimensional (multidimensional) array, when the list is empty, Len () is 0
Third, tuple (tuple) type
Increase: None
Delete: None
Change: None
Check: Tuplename[index]
Summary: Once the initialization is not modifiable, the code is more secure, can be used as a tuple.
Note: When you define a tuple of only one element, you also need to add ', ' after the first element ,
For example: t= (1,) if written in t= (1), where the parentheses are compiled by the compiler into a mathematical operation of the parentheses, it becomes a variable t,t defined value of 1, not a tuple
Iv. Common placeholders
%d integers
%s string
%f floating Point
Example:
>>> ‘Hi, %s, you have $%d.‘ % (‘Michael‘, 1000000)‘Hi, Michael, you have $1000000.‘
如果只有一个占位符,后边的%()中的()可以省略
>>>
‘Hi, %s‘%‘bingo‘
' Hi,bingo '
You can use the format () formatting string:
>>> ‘Hello, {0}, 成绩提升了 {1:.1f}%‘.format(‘小明‘, 17.125)‘Hello, 小明, 成绩提升了 17.1%‘
Beginner python: A basic part