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