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