Level 1 : what will be the output of the following code snippet


x = 1  
while True:  
    if x % 5 = = 0:  
        break  
    print(x)   
    x + = 1

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