toupper

How to change names to some friendly names in python?

How to change names to some friendly names in python? Question: I have few dummy function names and I want to transform them as follows: sample case 1 input : getDataType output: Data_Type sample case 2 input: getDatasetID output: Dataset_ID My code is as below: def apiNames(funcName): name = funcName.split("get")[1] print(”.join(‘_’ + char if char.isupper() …

Total answers: 2