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