ToMotion AI logo
Menu
Back to gallery

Public AI explainer video

For Loop ka Control Flow

इसके बाद आता है update। हर round के बाद value बदलती है। 1 के बाद 2, फिर 3। इस loop के एक पूरे round को iteration कहते हैं। हर iteration के बाद computer...

Prompt

Source idea used to generate this video.

Use following content & Explain it in hindi but in romanhindi, dont use hindi hard words, use English words for English Terms. Explain in Tutor Style, Also dont write Hindi words while explaining, only English letters can be used Control Flow Structures with For Loops.

Narration

Narration used to create this video.

Video narration

इसके बाद आता है update। हर round के बाद value बदलती है। 1 के बाद 2, फिर 3। इस loop के एक पूरे round को iteration कहते हैं। हर iteration के बाद computer फिर condition check करता है। यहीं एक जरूरी बात समझिए: repeat करने के लिए आपको वही code दस बार लिखने की जरूरत नहीं है। For loop एक rule बनाता है और उसी rule के अनुसार action दोहराता है। यही इस concept का बड़ा बदलाव है। अगर condition अभी भी true है, तो अगली iteration शुरू होती है। लेकिन जब value ऐसी हो जाती है कि condition false हो जाए, loop तुरंत stop हो जाता है। इसलिए roll call list के अंत में रुकता है, और loop अपने आप endless नहीं चलता। तो counting करने या list के हर item पर same task करने के लिए for loop बहुत उपयोगी है। और शुरुआती सवाल का जवाब यही है: computer काम को बार-बार इसलिए चलाता है क्योंकि हर round के बाद condition check होती है—और false होते ही वह रुक जाता है।