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