Level 5 : What will be the output of the following Python code?


i = 1
while True:
    if i%3 == 0:
        break
    print(i)
 
    i + = 1

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