Level 1 : what is the output of the following code?


dz = 1
while dz < 3:
      	print(dz) 
        if (dz == 2):
             	break 
        dz += 1

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