Level 9 : How many times will the loop run?


i=2

while(i>0):

    i=i-1

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