Back-End Programming Exam  >  Back-End Programming Videos  >  Python Tutorial in Hindi  >  Python tutorial in Hindi 23 : Infinite loop ; break ; continue statement ; password program

Python tutorial in Hindi 23 : Infinite loop ; break ; continue statement ; password program Video Lecture | Python Tutorial in Hindi - Back-End Programming

FAQs on Python tutorial in Hindi 23 : Infinite loop ; break ; continue statement ; password program Video Lecture - Python Tutorial in Hindi - Back-End Programming

1. क्या Python में अनंत लूप का उपयोग किया जा सकता है?
उत्तर. हां, Python में हम अनंत लूप का उपयोग कर सकते हैं। एक अनंत लूप एक ऐसा लूप होता है जिसमें शर्त की सत्यता सत्य होने के बावजूद लूप कार्य का निर्माण होता रहता है। हम `while True` का उपयोग करके अनंत लूप बना सकते हैं। हम इसे तब तक चलाते रख सकते हैं जब तक हम उचित स्थिति में `break` का उपयोग नहीं करते हैं।
2. `break` और `continue` स्टेटमेंट क्या हैं और इनका उपयोग कैसे किया जाता है?
उत्तर. `break` स्टेटमेंट का उपयोग एक लूप को तुरंत रोकने के लिए किया जाता है। जब `break` स्टेटमेंट लूप ब्लॉक के अंदर निर्मित होता है, तो यह लूप तत्काल रूप से खत्म हो जाता है और नियंत्रण को लूप के बाहर ले जाता है। `continue` स्टेटमेंट का उपयोग वर्तमान इटरेशन को छोड़कर अगले इटरेशन पर स्थानांतरित करने के लिए किया जाता है। जब `continue` स्टेटमेंट लूप ब्लॉक के अंदर निर्मित होता है, तो यह वर्तमान इटरेशन को छोड़ता है और आगे के लूप कार्य को छोड़ते हुए अगले इटरेशन में जाता है।
3. पासवर्ड प्रोग्राम में `break` और `continue` का उपयोग क्यों किया जाता है?
उत्तर. पासवर्ड प्रोग्राम में `break` स्टेटमेंट का उपयोग तब किया जाता है जब उपयोगकर्ता वैध पासवर्ड दर्ज करता है। जब वैध पासवर्ड दर्ज होता है, तो `break` स्टेटमेंट लूप को खत्म कर देता है और प्रोग्राम को आगे बढ़ने के लिए बाहर निकालता है। `continue` स्टेटमेंट का उपयोग पासवर्ड प्रोग्राम में वैधता की जांच करने के लिए किया जाता है। जब उपयोगकर्ता अमान्य पासवर्ड दर्ज करता है, तो `continue` स्टेटमेंट वर्तमान इटरेशन को छोड़कर अगले इटरेशन पर स्थानांतरित होता है और उपयोगकर्ता से दोबारा पासवर्ड दर्ज करने का अनुरोध करता है।
4. Infinite loop के उदाहरण क्या हो सकते हैं?
उत्तर. Python में अनंत लूप के उदाहरण में हम `while True` का उपयोग कर सकते हैं। नीचे दिए गए उदाहरण में एक सर्वर के बिना निर्दिष्ट संख्या के कनेक्शन अनंत रूप से चलते रहेंगे: ``` while True: print("Waiting for connection...") ```
5. `break` और `continue` के बीच क्या अंतर है?
उत्तर. `break` और `continue` दोनों स्टेटमेंट लूप नियंत्रण को प्रभावित करते हैं, लेकिन उनके बीच एक मुख्य अंतर है। `break` स्टेटमेंट लूप को पूरी तरह से खत्म कर देता है और नियंत्रण को लूप के बाहर ले जाता है, जबकि `continue` स्टेटमेंट वर्तमान इटरेशन को छोड़कर अगले इटरेशन पर स्थानांतरित होता है। अन्य शब्दों में, `break` लूप को पूरी तरह से खत्म कर देता है और `continue` लूप का केवल वर्तमान
Related Searches

past year papers

,

Extra Questions

,

Previous Year Questions with Solutions

,

study material

,

Objective type Questions

,

Free

,

pdf

,

practice quizzes

,

Important questions

,

Summary

,

Python tutorial in Hindi 23 : Infinite loop ; break ; continue statement ; password program Video Lecture | Python Tutorial in Hindi - Back-End Programming

,

ppt

,

Sample Paper

,

Exam

,

video lectures

,

Python tutorial in Hindi 23 : Infinite loop ; break ; continue statement ; password program Video Lecture | Python Tutorial in Hindi - Back-End Programming

,

Viva Questions

,

shortcuts and tricks

,

mock tests for examination

,

MCQs

,

Python tutorial in Hindi 23 : Infinite loop ; break ; continue statement ; password program Video Lecture | Python Tutorial in Hindi - Back-End Programming

,

Semester Notes

;