May 2017
Intermediate to advanced
280 pages
6h 2m
English
The min() function is just opposite to the max() function. It returns the dictionary's key with the lowest worth. The syntax of the method is as follows:
min(dict)
Consider the following example:
>>> dict1 = {1:"abc",5:"hj", 43:"Dhoni", ("a","b"):"game", "hj":56, (1,3):"kl"}>>> dict1{1: 'abc', (1, 3): 'kl', 5: 'hj', 43: 'Dhoni', 'hj': 56, ('a', 'b'): 'game'}>>> min(dict1)1>>>
Let's convert the list or tuple into a dictionary. In order to convert the list or tuple into a dictionary, the format should be as follows:
port = [[80,"http"],[20,"ftp"],[23,"telnet"],[443,"https"],[53,"DNS"]]
Alternatively, it can be as follows:
port = [(80,"http"),(20,"ftp"),(23,"telnet"),(443,"https"),(53,"DNS")]
We need pairs of two values. By using ...
Read now
Unlock full access