17. PYTHON (Struktur Kontrol) – Prioritas Operator

Belajar Bahasa Python Lengkap

Prioritas operator adalah konsep yang sangat penting di pemrograman. Ini akan membuat urutan operasi seperti matematika, operator mana yang akan didahulukan untuk dieksekusi.

Operator == lebih tinggi dibandingkan operator or.

>>> False == False or True
True
>>> False == (False or True)
False
>>> (False == False) or True
True

Untuk rumus urutan prioritas operator dari yang tertinggi sampai dengan yang terendah bisa dilihat pada gambar di bawah ini.


LANJUTKAN BACA MATERI LENGKAP


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.