Python Keywords & Identifiers

Postingan sekarang akan membahas mengenai keywords dan identifiers Python, setelah sebelumnya telah belajar mengenai cara install python dan menjalankan program pertama kali pada postingan Python Tutorial Untuk Pemula.


Python Keywords

Keywords di python mudahnya bisa dikatakan kata yang telah disediakan dan kata tersebut tidak bisa digunakan untuk menamakan sebuah entity lain (ex : variables, classes, dan functions).

Memangnya apa kegunaan keywords python? Keywords tersebut digunakan untuk men-define struktur dan sintaks dari bahasa pemrograman python.
list keywords python (sumber: my screen shoot)
Terdapat 35 keywords python (cmiww), meskipun jumlah ini akan berbeda seiring berjalannya waktu. Python tergolong case sensitive, jadi ketika sedang menuliskan keywords yaaa harus sama. Berikut daftar semua keywords yang ada dibahasa pemrograman python :
>>> help()
If this is your first time using Python, you should definitely check out
the tutorial on the Internet at https://docs.python.org/3.8/tutorial/.
Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".
To get a list of available modules, keywords, symbols, or topics, type
"modules", "keywords", "symbols", or "topics".  Each module also comes
with a one-line summary of what it does; to list the modules whose name
or summary contain a given string such as "spam", type "modules spam".

>? keywords

Here is a list of the Python keywords.  Enter any keyword to get more help.
False               class               from                or
None                continue            global              pass
True                def                 if                  raise
and                 del                 import              return
as                  elif                in                  try
assert              else                is                  while
async               except              lambda              with
await               finally             nonlocal            yield
break               for                 not

Python Identifiers



Python Variable


Aturan penulisan Identifiers