There is no swich in Python. case, to achieve the same functionality, and do not want to use the IF: Elif to make the best use of the dictionary to achieve
Mainly want to call different methods through different keys, in the learning process, found no matter what the input key is, as long as the dictionary has output content, each time will be output, which is different from the functions that they need.
After debugging, it is found that the problem mainly occurs in the key value corresponding to the method name of the value that has no belt () has a large relationship, as follows:
No matter what number in BB is filled in, it always outputs 123
If CS () is changed to CS, then only 123 will be output when the call is 2, or the return method can be selected without adding ()
Python implements switch with a dictionary. Case-like function call