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