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