Level 9 : What is the correct option for the below code?


i = 0
while i < 5:
    print(i)
    i += 1
    if i == 3:
        break
else:
    print(0)

Author: HareramG | Tags: loop | 1859+ Python FAQs | Share
formatting-with-strftime | list-mutation | conversion | complex | debugging | counter | decimal | dictionary-methods | boolean | indentation | datatype | opening-files-(open()) | boolean-masking | list-method | collection | matplotlib | logical-operator | namespace | arbitrary-arguments-(*args,-**kwargs) | directory-operations | gil | matrix | generators | array | python_version | magic-method | logical-operation | pseudocode | list-slicing | built-in | python-django | parameter | mathematical-function | dataframe-and-series-objects | filter-function | operators | global-variable | membership-operators-(in,-not-in) | encoding | format | match | bitwise-operator | expand-tab | nested-loop | function-and-scope | module | formal-and-actual-parameter | error-handling | generators-in-python | exception | list-methods-and-slicing | destructor | pep | raise-statement | string-methods | random | multiple-inheritance | pandas | using-lists-as-stacks | handling-missing-values-(fillna,-dropna) | operator-and | built-in-function | regex | basic | numpy | numeric | bitwise-operator | class-and-instance-variable | string-concatenation | type_conversion | shallow-copy | python-module | complex-number | frozenset | integers | loop | statement | working-with-dates-and-times | join | data-type | pass | odd-number | quantifiers-(*,-+,-?,-{}) | command-line-parsing | docstring | python | package-management | access-modifier | comprehension | deep-copy | namedtuple | class-decorators | defining-functions | class-and-object | typeerror | reading-and-writing-large-files-efficiently | error-handling | function | slice | multiple-except-blocks | set | logical-operators | goto-function | control-statement | regular-expressions | call | escape-operator | head-and-tail | file-handling | conditional-statements | append | immutability | round | list-indexing | thread | version | memory-management | dictionaries | mathematics | operator | print-statement | default-mutable-argument | heap-memory | string-method | exception-handling | python-syntax-and-structure | lists | precedence-and-associativity | iterable | objects | writing:-write(),-writelines() | raise | choice | with-statement | single-inheritance | filter | binary-operation | assert | mysql | polymorphism | center | for | list-comprehensions | zip-function | object-attribute | strings | intering | lambda-function | list-comprehension | built-in-modules | datetime.date,-datetime.time,-datetime.datetime | class-and-inheritance | working-with-temporary-files-using-tempfile | default-arguments | sorting-and-ranking | syntax | __init_subclass__ | literal-characters-and-special-characters | control-flow | decorator | operations | overriding-methods | min-function | sys-module | swapping | map-function | multiple-inheritance | global-keyword | oop | operand | loop-control | loop-control-statements | software-design | managing-directories-with-os-and-shutil | walking-through-directories-using-os.walk() | operator-overloading | aggregating-data-with-functools.reduce() | feature | print | introduction-to-multiprocessing | functional-programming | global-variable | pickling--unpickling | loops | range | syntaxerror | collections | invalid-list | comment | math | method | oops | parsing-with-strptime | creating-custom-modules | multithreading | max-min | else-statement | data-structures | constructor | assignment-operators | zfill-function | python-history | thread-synchronization | binary | conditional-statement | python-repl | sum() | data-types | thread-safe-data-structures-(queue.queue) | arithmetic-operation | exponentiation | overflow | built-in-function | enumerate() | filtering-and-indexing | reading-and-writing-files | syntax-error | tuples | error | file | factorial-function | list | string-slicing | data-type | counter-function | benefit | anchors-(^,-$) | random-function | turtle | lambda-functions | identity-operators-(is,-is-not) | type-conversion | precedence | async | library | split | memory | classes | mapping-function | identity-operator | input-function | staticmethod | postfix | data-structure | function-argument | while-loops | expression | bitwise | update | round-function | control-flow | descriptors | boolean-and-non-boolean | reading:-read(),-readline(),-readlines() | using-else-and-finally | floats | recursion | threading | lambdas | inheritance | python-operators | method-overloading | type-conversion-and-casting | application | return-statement | slicing | time-series-with-pandas | using-map()-for-transformations | advanced-file-operations | multiprocessing | asyncio | difference-between-threads-and-processes | fabs-function | arithmetic-expression | compute | math-copysign | sets | string-slicing | operator-or | list,-set,-and-dictionary-comprehensions | __all__-attribute | exception-handling | recurssion | iterator | floating-point-precision | __future__ | type-conversion | sorted | stack | immutable-data-type | using-yield-in-functions | generator | tuple-methods | higher-order-function | attribute | functional-programming | assignment-operator | design-principle | version-check | list-vs-tuple | asyncio-module | input-function | class | string | copy | global | file-handling | name-mangling | file_handling | zip | introduction-to-python | booleans | installation | mutable | why-use-multiprocessing-over-threading?-(gil) | methods | data_structure | dicts | data-structure | condition | working-with-binary-files-(rb,-wb) | list-comprehension | min-max-function | import-method | set-operation | while-loop | while-and-for-loop | matrix-list-comprehension | list-operation | data-structures-in-python | scientific-notation | keyword | else | string-manipulation | virtual-environment | rollback | functions | encapsulation | id-function | list-join | string-formatting | touples | context-manager | identifier | conditional-statement | joining-and-merging-dataframes | sum-function | init | input | tuple | string-formatting | iterators | using-assertions-(assertequal,-assertraises) | lambda | key-value-pairs | using-os-and-pathlib-modules | introduction-to-threads | def | virtual-environment | static-method | syntax-error | variable | unit-testing | implementation | identity-operator | sys | data-type-conversions | creating-and-starting-threads | integer | sorting | yield | inherit | test-discovery | using-the-threading-module | dictionary-comprehensions | string-iteration | indexing | using-join()-and-is_alive()-methods | datetime | dictionary | working-with-file-paths | tuple-unpacking | regular-expression | while-else-loop | indexing:-loc-vs-iloc | int | string-method | comparison | logical-operator | interpreter ...