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