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