Sources of the standard Python functions

2

How can I find out the algorithm behind functions like split() and in in Python, because in my college there are some forbidden functions.

    
asked by anonymous 01.12.2018 / 01:25

2 answers

1

Yes, you can see split() , but it will not be worth anything.

There are other variations of it.

The in is an operator and not a function. It has its source code on Github, a little harder to find, but at least now you know where it is.

My recommendation is that you do what the exercise asks for and do not look for shortcuts, their idea is not to copy from somewhere (and note that not even look for you), the goal is to understand the problem and produce an algorithm of your you will learn to program. Copying things ready to a computer can do.

    
01.12.2018 / 01:55
-2

In Python there's really no way.

Python is an interpreted language, much less efficient than languages like C or Java. To improve performance, much of the standard Python library was implemented in native code, that is, there is no Python code behind the split, there is only compiled machine code that is not humanly understandable.

    
01.12.2018 / 01:52