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