Pelokalan
Python ID
id en
Masuk
Proyek
tutorial__introduction.po Berkas proyek · python-docs-id-3.14 · Bahasa Indonesia
Modul PO Hanya lihat
Teks sumber — English
Terjemahan — Bahasa Indonesia
Numbers
Angka
The integer numbers (e.g. ``2``, ``4``, ``20``) have type :class:`int`, the ones with a fractional part (e.g. ``5.0``, ``1.6``) have type :class:`float`. We will see more about numeric types later in the tutorial.
Bilangan bulat (mis. ``2``, ``4``, ``20``) memiliki tipe :class:`int`, yang memiliki bagian pecahan (mis.``5.0``,``1.6``) memiliki tipe :class:`float`. Kita akan melihat lebih banyak tentang tipe bilangan nanti dalam tutorial.
In addition to :class:`int` and :class:`float`, Python supports other types of numbers, such as :class:`~decimal.Decimal` and :class:`~fractions.Fraction`. Python also has built-in support for :ref:`complex numbers <typesnumeric>`, and uses the ``j`` or ``J`` suffix to indicate the imaginary part (e.g. ``3+5j``).
Selain :class:`int` dan :class:`float`, Python mendukung tipe angka lainnya, seperti :class:`~decimal.Decimal` dan :class:`~fractions.Fraction`. Python juga memiliki dukungan bawaan untuk :ref:`complex numbers <typesnumeric>`, dan menggunakan akhiran ``j`` atau ``J`` untuk menunjukkan bagian imajiner (mis. ``3+5j``).
Python can manipulate text (represented by type :class:`str`, so-called "strings") as well as numbers. This includes characters "``!``", words "``rabbit``", names "``Paris``", sentences "``Got your back.``", etc. "``Yay! :)``". They can be enclosed in single quotes (``'...'``) or double quotes (``"..."``) with the same result [#]_.
Indices may also be negative numbers, to start counting from the right::
Indeks juga bisa berupa angka negatif, untuk mulai menghitung dari kanan::
The first row of numbers gives the position of the indices 0...6 in the string; the second row gives the corresponding negative indices. The slice from *i* to *j* consists of all characters between the edges labeled *i* and *j*, respectively.
Baris pertama angka memberikan posisi indeks 0...6 dalam string; baris kedua memberikan indeks negatif yang sesuai. Irisan dari *i* ke *j* terdiri dari semua karakter di antara kedua sisi yang berlabel *i* dan *j*.