Keywords
Keywords पाइथन language में कुछ ऐसे words होते हैं जो पहले से ही किसी निश्चित काम को करने के लिए reserve किये हुए है। जब कोड लिखते समय हम इन keywords का उपयोग करते हैं तो यह words अलग-अलग color से लिखे होते हैं जिससे यह कोड के बाकी words से अलग दिखाई देते हैं।
इन reserve words का use हम किसी class या variable के नाम के लिए नहीं कर सकते है। python में ये case sensitive होते हैं
How to check python keywords-
- help(‘keywords’)
- import keyword
print(keyword.kwlist)
Python 35 Keywords |
|||
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 |
|
Keywords
Keywords are specific words that have specific meaning for the compiler or the interpreter. These are reserved words and are used in the program exactly as they are. In Python 3.8, there are 35 different keywords that we can use. These are as follows:
We cannot use these reserved words for the name of any class or variable. These are case sensitive in python
How to check python keywords-
- help(‘keywords’)
- import keyword
print(keyword.kwlist)
Python 35 Keywords |
|||
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 |
|