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