Built-in functions — Python 3.15.2 documentation
Code objects can be executed by exec() or eval() . source can either be a normal string, a byte string, or an AST object. Refer to the ast module documentation ...
Code objects can be executed by exec() or eval() . source can either be a normal string, a byte string, or an AST object. Refer to the ast module documentation ...
Return the string representing a character whose Unicode code point is the integer i. For example, chr(97) returns the string 'a', while chr(8364) returns the string '€'. This is the inverse of ord(). The valid range for the argument is from 0 through 1,114,111 (0x10FFFF in base 16).
23 hours ago · This module defines an object type which can compactly represent an array of basic values: characters, integers, floating-point numbers, complex numbers. Arrays are mutable sequence types and behav...
Source code: Lib/bisect.py This module provides support for maintaining a list in sorted order without having to sort the list after each insertion.
The following example shows how to loop through header information in a ZIP file without using the zipfile module. Pack codes "H" and "I" represent two and four byte unsigned numbers respectively. The "<" indicates that they are standard size and in little-endian byte order
23 hours ago · The array module provides an array object that is like a list that stores only homogeneous data and stores it more compactly. The following example shows an array of numbers stored as two byte unsigned binary numbers (typecode "H") rather than the usual 16 bytes per entry for regular lists of Python int objects:
In the following examples, input and output are distinguished by the presence or absence of prompts (>>> and …): to repeat the example, you must type ...
For example, list('abc') returns ['a', 'b', 'c'] and list( (1, 2, 3) ) returns [1, 2, 3]. If no argument is given, the constructor creates a new empty list, []. Many other operations also produce lists, including the sorted() built-in. Lists implement all of the common and mutable sequence operations.
Symbols · call · class definition · function definition · generator expression · in assignment target list · in printf-style formatting, [1] · in regular expressions.
array¶. Add the 'w' type code (Py_UCS4) for Unicode characters. It should be used instead of the deprecated 'u' type code.Porting to Python 3.13¶. This section lists previously described changes and other bugfixes that may require changes to your code.
23 hours ago · Note If len is greater than zero, the returned list object’s items are set to NULL. Thus you cannot use abstract API functions such as PySequence_SetItem () or expose the object to Python code before setting all items to a real object with PyList_SetItem () or PyList_SET_ITEM ().
An example of a built-in method is alist.append() , assuming alist is a list object. In this case, the special read-only attribute __self__ is set to the ...
Python 3.15 is the latest stable release of the Python programming language, with a mix of changes to the language, the implementation, and the standard library ...
23 hours ago · For an informal introduction to the language, see The Python Tutorial. For C or C++ programmers, two additional manuals exist: Extending and Embedding the Python Interpreter describes the high-level picture of how to write a Python extension module, and the Python/C API reference manual describes the interfaces available to C/C++ programmers in ...
Source code: Lib/os.py This module provides a portable way of using operating system dependent functionality. If you just want to read or write a file see ...