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