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