• পাইথন প্রোগ্রামিং : লুপ (Python Loops)

    1.8 Python Loops

    অনেক সময় এমন অবস্থা তৈরি হয় যে একটি নির্দিষ্ট ব্লকের কোড অনেকবার চালানো লাগে, তখন লুপ এর প্রয়োজন হয়। নিচের ছবিটি লক্ষ্য করিঃ
    Loop

    Python প্রোগ্রামিং ল্যাঙ্গুয়েজে নিচের লুপ গুলো প্রচলিত

    .
    Loop TypeDescription
    while loopRepeats a statement or group of statements while a given condition is TRUE. It tests the condition before executing the loop body.
    for loopExecutes a sequence of statements multiple times and abbreviates the code that manages the loop variable.
    nested loopsYou can use one or more loop inside any another while, for or do..while loop.

    Loop Control Statements

    কোডিং এর সময় সাধারণ নিয়মের/ সিরিয়ালের পরিবর্তন বোঝাতে Loop control statements এর প্রয়োজন হয়। যখন একটি নির্দিষ্ট লুপের পরিসীমার বাইরের কোড রান হয় তখন ঐ পরিসীমার সকল অবজেক্ট ধ্বংস হয়ে যায়। Python নিচের কন্ট্রোল স্টেটমেন্ট গুলো সাপোর্ট করে।

    Control StatementDescription
    break statementTerminates the loop statement and transfers execution to the statement immediately following the loop.
    continue statementCauses the loop to skip the remainder of its body and immediately retest its condition prior to reiterating.
    pass statementThe pass statement in Python is used when a statement is required syntactically but you do not want any command or code to execute.

  • 0 comments:

    Post a Comment

    New Research

    Attention Mechanism Based Multi Feature Fusion Forest for Hyperspectral Image Classification.

    CBS-GAN: A Band Selection Based Generative Adversarial Net for Hyperspectral Sample Generation.

    Multi-feature Fusion based Deep Forest for Hyperspectral Image Classification.

    ADDRESS

    388 Lumo Rd, Hongshan, Wuhan, Hubei, China

    EMAIL

    contact-m.zamanb@yahoo.com
    mostofa.zaman@cug.edu.cn

    TELEPHONE

    #
    #

    MOBILE

    +8615527370302,
    +8807171546477