"of".index
is the index
function of str
.It return the index of an element. The function takes an element, which must be inside the str.
If not, it will raise a ValueError.
The key function is called for each char in the str (str is iterable).
The sort order is defined as follows: o == 0 and f == 1
This means, that after sorting, the
o
comes first, then the f
.It's a strange way to get a custom defined sorting order for str.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!