Level 9 : What is the output of this code?


x = 3
while x > 0:
    print(x)
    x -= 1

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