Pelokalan
Python ID
id en
Masuk
Proyek
builtins__stdtypes.po Berkas proyek · python-docs-id-3.14 · Bahasa Indonesia
Modul PO Hanya lihat
Teks sumber — English
Terjemahan — Bahasa Indonesia
Some operations are supported by several object types; in particular, practically all objects can be compared for equality, tested for truth value, and converted to a string (with the :func:`repr` function or the slightly different :func:`str` function). The latter function is implicitly used when an object is written by the :func:`print` function.
Beberapa operasi didukung oleh beberapa jenis objek; khususnya, secara praktis semua objek dapat dibandingkan untuk kesetaraan, diuji untuk nilai kebenaran, dan dikonversi ke string (dengan fungsi :func:`repr` atau yang sedikit berbeda fungsi :func:`str`). Fungsi terakhir secara implisit digunakan ketika suatu objek ditulis oleh fungsi :func:`print`.
if either argument is a complex or a floating-point number, the other is converted to a floating-point number;
*x* converted to integer
*x* converted to floating point
String literals that are part of a single expression and have only whitespace between them will be implicitly converted to a single string literal. That is, ``("spam " "eggs") == "spam eggs"``.
Return a copy of the string with all the cased characters [4]_ converted to lowercase. For example:
If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters (strings of length 1) to Unicode ordinals, strings (of arbitrary lengths) or ``None``. Character keys will then be converted to ordinals.
Return a copy of the string with uppercase characters converted to lowercase and vice versa. For example:
Return a copy of the string with all the cased characters [4]_ converted to uppercase. Note that ``s.upper().isupper()`` might be ``False`` if ``s`` contains no cased characters or if the Unicode category of the resulting character(s) is not "Lu" (Letter, uppercase), but e.g. "Lt" (Letter, titlecase).
By default, the value of a replacement field expression is converted to a string using :func:`str`::
After the expression has been evaluated, and possibly converted using an explicit conversion specifier, it is formatted using the :func:`format` function. If the replacement field includes a *format specifier* introduced by a colon (``:``), the specifier is passed to :func:`!format` as the second argument. The result of :func:`!format` is then used as the final value for the replacement field. For example::
The converted value is left adjusted (overrides the ``'0'`` conversion if both are given).
No argument is converted, results in a ``'%'`` character in the result.
Return a copy of the sequence with all the uppercase ASCII characters converted to their corresponding lowercase counterpart.
Return a copy of the sequence with all the lowercase ASCII characters converted to their corresponding uppercase counterpart and vice-versa.
Return a copy of the sequence with all the lowercase ASCII characters converted to their corresponding uppercase counterpart.
For non-contiguous arrays the result is equal to the flattened list representation with all elements converted to bytes. :meth:`tobytes` supports all format strings, including those that are not in :mod:`struct` module syntax.
*order* can be {'C', 'F', 'A'}. When *order* is 'C' or 'F', the data of the original array is converted to C or Fortran order. For contiguous views, 'A' returns an exact copy of the physical memory. In particular, in-memory Fortran order is preserved. For non-contiguous views, the data is converted to C first. *order=None* is the same as *order='C'*.