Level 1 : How many times will the following loop run?


for i in range(2, 10, 2):
    print(i)

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