Basic Python knowledge and basic python tutorials
Python loop, if you already have programming experience, these are all trivial for you.
Names = ["Zhang San", "Li Si", "Wang Wu"] for name in names: print (name)
Python loops include not only the For loop, but also the While loop.
n=99while n>0: n=n-1 print(n)
I will not display the display results because it is too troublesome to take screenshots and Import images.
How to Use Dict and Set
Dict operates through key-value pairs like JSON
Read content in Dict
Dics = {"a": "Zhang San", "B": "Li Si", "c": "Wang Wu"} print (dics ["a"])
Dics = {"a": "John", "B": "Lee"} print (dics. get (""))
Deletes an element of Dict.
Dicts = {"a": "John", "B": "Lee"} dicts. pop ("")
Similar to dict, set is also a set of keys, but does not store values. Because keys cannot be repeated, there are no duplicate keys in the set.
>>>st=set([1,2,3,4])>>>st{1,2,3,4}
Add set
St. add (5)
If the same element is added, the filter is performed.
St. add (4)
Show {1, 2, 3, 4}
Set deletes an element.
St = set ([1, 2, 4])
St. remove (1)
{2, 3, 4}
List Sort
>>> A = [,]
>>> A. sort ()
[,]