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