Results for “python split example documentation script code java site:docs.python.org”
docs.python.org
5. Data Structures — Python 3.15.2 documentation
You might have noticed that methods like insert, remove or sort that only modify the list have no return value printed – they return the default None. [1] This is a design principle for all mutable data structures in Python.
docs.python.org
Built-in Types — Python 3.15.2 documentation
Again, if the result is -1 , it's replaced with -2 . To clarify the above rules, here's some example Python code ... Split the string at the first ...
docs.python.org
Built-in Types — Python 3.12.16 documentation
Python’s generators provide a convenient way to implement the iterator protocol. If a container object’s __iter__() method is implemented as a generator, it will automatically return an iterator object (technically, a generator object) supplying the __iter__() and __next__() methods.
docs.python.org
4. More Control Flow Tools — Python 3.15.2 documentation
This is superficially similar to a switch statement in C, Java or JavaScript ... Examples, recipes, and other code in the documentation are additionally ...
docs.python.org
argparse — Parser for command-line options, arguments and...
For a more gentle introduction to Python command-line parsing, have a look at the argparse tutorial.Sometimes a script only needs to handle a specific set of command-line arguments, leaving any unrecognized arguments for another script or program.
docs.python.org
Regular expression HOWTO — Python 3.15.2 documentation
For example: [5^] will match either a '5' or a '^' . Perhaps the most important metacharacter is the backslash, \ . As in Python string literals, the backslash ...
docs.python.org
9. Classes — Python 3.15.2 documentation
For example, passing an object is cheap since only a pointer is passed by the implementation; and if a function modifies an object passed as an argument, the caller will see the change — this eliminates the need for two different argument passing mechanisms as in Pascal.
docs.python.org
string — Common string operations — Python 3.15.2 documentation
Source code: Lib/string/__init__.py String constants: The constants defined in this module are: Custom string formatting: The built-in string class provides ...
docs.python.org
6. Modules — Python 3.15.2 documentation
6.1.1. Executing modules as scripts. 6.1.2. The Module Search Path. 6.1.3. “Compiled” Python files.the code in the module will be executed, just as if you imported it, but with the __name__ set to "__main__". That means that by adding this code at the end of your module
docs.python.org
pydoc — Documentation generator and online help system ...
Source code: Lib/pydoc.py The pydoc module automatically generates documentation from Python modules ... Python interpreter by running pydoc as a script ...
docs.python.org
Design and History FAQ — Python 3.15.2 documentation
Can Python be compiled to machine code, C or some other language? How does Python manage memory? Why doesn't CPython use a more traditional garbage collection ...
docs.python.org
The Python Tutorial — Python 3.15.2 documentation
15 hours ago · Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming.