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