सीधे मुख्य सामग्री पर जाएं

Python Reserved word क्या है (Python Reserved word in hindi)

 दोस्तो आज हमे जानने की Python Reserved word क्या है (Python Reserved word in hindi)Reserved word एक ऐसे word होता है जो compiler मे पहले से ही defined होता है। किसी भी programming Language मे keyword बहुत ही महत्वपूर्ण topic होता है python 3.7 में 33 Reserved word/keyword  होते है तो चलाइए इसे विस्तार से समझते हैं की  Python Reserved word क्या है (Python Reserved word in hindi)


Introduction (परिचय)


Python Reserved word को Reserved keyword या Keyword भी कर सकते है। Keyword एक word होता जो compiler मे predefined होता है इसका अर्थ Compiler को पहले से ही पता होता है की इस word का क्या अर्थ है और compiler उस उससे प्रकार से execute करता है। 

प्रत्येक keyword का एक specific meaning व special operation होता हैं keyword को use करने के लिए निधारित नियम होते हैं जिन्हें syntax कहते हैं। Python मे 33 keyword होते है लेकिन इनकी संख्या कम या बढ़ती होती रहती हैं। keyword case sensitive होते हैं मतलब True और true दोनो अलग-अलग होते हैं 



Types of Python Reserved Word (Python Reserved Word के प्रकार)


Python Reserved word in hindi ,Python Reserved word क्या है ,python keywords, python reserved keyword



1) and- यह true return करता है यदि सभी condition true हो।


2) not- not keyword का प्रयोग दिए गए operand को True से False या False से true में convert करने के लिए किया जाता है 


3) or- यदि दिए गए operands में से एक भी operand true होता है, तब यह true return करता हैं 


4) as- इस का इस्तेमाल alias (उपनाम ) create करने के लिए किया जाता हैं

Ex- import math as mt

यहाँ math module को import किया गया लेकिन इस का उपनाम mt create किया गया है अब program में जब भी math module का Use करना हो तो हम mt के दावरा कर सकते हैं 


5) break- इसका use program के execution को break करने के लिए किया जाता है।


6) Continue- Continue keyword का प्रयोग iterate हो रहे कुछ statements को skip करने के लिए किया जाता है। 


7) if- if का use किसी condition को check करने के लिए किया जाता


8) else- इसका use if के साथ किया जाता है यदि किसी condition के 2 output हो तो else का use किया जाता है condition true होने पर if statement व false होने पर else statement execute होती हैं 


9) elif- यदि 2 या 2 से अधिक condition हो तो इसका use होता है।


10) false- false एक boolean value होती है जो 0 के equal होती है यदि कोई condition या statement गलत होती है तो false return होती हैं 


11) true- true एक boolean value होती है जो 1 के equal होती है यदि कोई condition या statement  सही होती है तो true return होती हैं 


12) for- for keyword का use looping मे होता है।


13) from- from का use किसी module मे से किसी special function को import करने के लिए लिया जाता है


14) global- इसका use global variable create करने के लिए किया जाता है।


15) import- इसका use module को import करने के लिए किया जाता है।


16) in- इसका use collection(Tuple, list, string, dictionary ) के element को access करने के लिए किया जाता हैं 


17) none- none का मतलब कोई value नहीं होती। अगर function कोई value-return नहीं करता है तो None return करता है।


18) raise- raise का use exception को raise करने के लिए किया जाता है 


19) return- इसका use का कुछ value को return करने के लिए किया जाता है 


20) Class- User के द्वारा classes को define करने के लिए class keyword का use किया जाता है।


21) def- def keyword use user-defined function बनाने के लिए किया जाता है।


22) del- del का अर्थ delete होता हैं 

del का प्रयोग list, tuple, dictionary या किसी और collection में element को delete करने के लिए किया जाता है।

23) except- except का प्रयोग exception/error handling के लिए किया जाता है। try clause के साथ except का प्रयोग किया जाता है।


24) try- try का प्रयोग exception handling में किया जाता है जो code exception check करता है। इसमें code को try block पर लिखा जाता है।


25) Finally- finally का प्रयोग try-except या try block के साथ किया जाता है। exception/error   हो या ना हो finally block execute होता हैं


26) assert- assert check करता है कि कोई भी दिया गया expression true हैं या false है। program Execution तभी process होता है जब expression true होता है। यदि false होगा तो यह assert exception error को raise करता है 


27) nonlocal- nonlocal का प्रयोग nested function के लिए किया जाता है।

nonlocal variable global नहीं होते। अगर inner function में इनको लिया जाता है तो outer functions में इनकी value परिवर्तित नहीं होती है।


28) is- इस का प्रयोग object equality के लिए किया जाता है। ये keyword = = operator के तरह ही होता हैं 


29) pass- pass का प्रयोग loops, functions और classes को रिक्त रखने के लिए होता है। ये एक null statement/block होता हैं।pass statement का इस्तेमाल एक ही line पर या separate line पर भी किया जाता है।


30) While- While keyword का प्रयोग looping के लिए किया जाता है। जब तक while condition true होती है, तब तक statement iterate होता रहता है और अगर condition false या loop break किया जाता है, तब loop iteration बन्द हो जाता


31) with- with keyword का प्रयोग File handling के लिए किया जाता है। जब file के लिए 'with-as' statement का प्रयोग किया जाता है तब file को close करने की जरूरत नहीं पड़ती है।


32) yield- yield का प्रयोग function के लिए return statement की तरह ही किया जाता है।


33) lambda- python में lambda function को anonymous function भी कहते है। anonymous function वह function होते है जिन्हें बिना name के defined किया जा सकता है। 


आज हमने क्या सीखा ?


Python एक लोकप्रिय प्रोग्रामिंग भाषा है जो विभिन्न एप्लिकेशन्स के लिए व्यापक रूप से उपयोग की जाती है। keywords को समझना कोड को तैयार करने के लिए क्रियाशील और प्रभावी बनाने के लिए महत्वपूर्ण होता है। इस Python Reserved word क्या है ( what is python Reserved word in Hindi) में विस्तार से बताए हैं, यह ध्यान देना जरूरी है कि कीवर्ड्स को जानना महत्वपूर्ण है, लेकिन यह language सीखने का शुरुआती बिंदु होता है। यदि आप को कुछ problem हो तो आप comment कर सकते हैं


टिप्पणियाँ

एक टिप्पणी भेजें

इस ब्लॉग से लोकप्रिय पोस्ट

Python control statements क्या है ( What is Python control statement in hindi )

Python tutorial में आज हम जानगे की Python control statements क्या है ( What is Python control statement in hindi ) किसी भी programming language में Control statement बहुत ही महत्वपूर्ण होता इसके बिना programming नहीं की जा सकती है आइए इस विस्तार में समझते हैं की Python control statements क्या है ( What is Python control statement in hindi )  INTRODUCTION   Program में condition के अनुसार statement को control करने के लिए control statement का उपयोग किया जाता है। इस हमे decision  making statement भी कहते हैं 1) if Statement- if statement में किसी condition को check किया जाता है यदि condition true होती हैं तो if block मे लिखी statement execute हो जाते हैं और यदि condition false है तो if के block में लिख code को ignore कर दिया जाता है। Syntax- if condition:     Statements Example- a = 10 b = 20 if b > a:   print("b is greater than a") Output- b is greater than a 2) if-else- if-else statement भी if की तरह होता है difference बस इतना है की इसम...

Python environment variable क्या है? ( What is Python environment variables in hindi )

दोस्तों Python के tutorial मे आगे बढ़ते हुए आज हमे सीखे की Python environment variable क्या है? ( What is Python environment variables in hindi ) तो चलाइए इस विस्तार में समझते हैं  Introduction   Environment variable एक dynamic object होता है जिसमे editable value होती है इसका use computer मे एक या एक से ज्यादा software करते हैं environment variable का use program को यह जानने में help करता है की file को किस directory मे store किया जाए। temporary file को कहा store किया जाता file को कहाँ से access किया जाए आदि। Different Environment variable  PYTHONPATH- यह PATH के समान ही होता है। यह Interpreter को बताता है की program में import की गयी module file को कहाँ locate करना है। PYTHONPATH कभी-कभी Python installer द्वारा भी प्रस्तुत किया जाता है।  PYTHONSTARTUP-  यह उस file के path को store करता है जो Python Source कोड को initialize करती है। जब भी interpreter start होता है, तब यह execute होता है। यह PYTHONPATH को modify या utilities को लोड करने का command अपने पास रखता...

Python Idle क्या है (What is Python Idle in Hindi)

दोस्तों Python Tutorial में आज हम पाइथन Idle क्या है (What is Python Idle in Hindi)  देखेग। यदि आप coding करना चाहते हैं तो आप को इसके बारे में पता होना चाहिए। यह एक ऐसा software हैं जिसके द्वारा बडी आसानी से programmers program को लिख सकता है, execute कर सकता है व edit कर सकता है। यह सभी programming language के लिए बहुत महत्वपूर्ण होता यह programmers को program को लिखने के graphical user interface provide करता है तो चलाइए इस विस्तार में समझते हैं। Introduction to Python Idle ( पायथन idle का परिचय ) IDLE का पूरा नाम Integrated Development and Learning Environment हैं। यह एक ऐसा software है जो program को आसानी से लिखने व run करने के लिए environment प्रदान करता है। जिस प्रकार computer में note making के लिए wordpad होता है जिसमे note making के लिए बहुत सारे features होते है ठीक उससे प्रकार program को run व लिखने के लिए इसका use होता है जिसमे विभिन्न features, extension व short cut के माध्य से program को लिखना सुविधाजनक व आसान बनाया जाता है। Python IDLE 2 mode मे कार्य करता हैं। Int...