Level 1 : 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: loop | 1736+ Python FAQs | Share
pickling-&-unpickling | int | pep | decimal | parameter | keyword | input-function | destructor | odd-number | dictionaries | comment | module | namespace | mathematical-function | call | software-design | sum-function | lambda-function | overflow | python-django | basic | enumerate() | fabs-function | math-copysign | identifier | data-structure | turtle | python_version | application | file_handling | generators-in-python | syntax-error | descriptors | static-method | objects | collections | global | scientific-notation | version | threading | list-comprehension | multiprocessing | input | choice | matrix-list-comprehension | random-function | iterable | syntaxerror | loops | context-manager | pandas | collection | list-method | operator | design-principle | max-min | functional-programming | indentation | memory | data-type | bitwise | tuple | immutability | string-slicing | input-function | update | immutable-data-type | data_structure | lists | global-keyword | python-history | exception-handling | counter-function | python-repl | list-comprehension | data-structures | round-function | copy | polymorphism | string-slicing | numeric | string-manipulation | library | recurssion | boolean-and-non-boolean | logical-operation | stack | benefit | __init_subclass__ | inheritance | operators | python-module | data-type | zip | constructor | random | indexing | decorator | set-operation | mutable | matrix | list-slicing | zip-function | min-function | expand-tab | operations | join | bitwise-operator | command-line-parsing | comprehension | class-and-inheritance | staticmethod | range | classes | list-vs-tuple | dicts | name-mangling | file-handling | virtual-environment | mathematics | def | virtual-environment | raise | built-in | error-handling | binary-operation | lambda | floating-point-precision | variable | identity-operator | function-argument | zfill-function | lambdas | factorial-function | print | bitwise-operator | type_conversion | precedence | syntax-error | split | interpreter | object-attribute | type-conversion | match | assert | assignment-operator | string-method | nested-loop | namedtuple | functions | oop | string-concatenation | iterator | mapping-function | mysql | built-in-function | head-and-tail | control-flow | math | operator-or | logical-operator | list-operation | init | class-and-instance-variable | attribute | import-method | async | global-variable | higher-order-function | invalid-list | sorted | type-conversion | operand | built-in-function | generators | datatype | while-loop | rollback | dictionary | deep-copy | string-iteration | binary | tuple-unpacking | logical-operator | touples | while-else-loop | list-join | datetime | list | access-modifier | control-statement | default-mutable-argument | sorting | goto-function | condition | operator-overloading | for | class | integer | data-structure | formal-and-actual-parameter | error | regular-expression | else-statement | numpy | print-statement | inherit | exception | heap-memory | file | feature | magic-method | yield | array | expression | regex | class-and-object | while-and-for-loop | string | append | debugging | list-indexing | method | function | typeerror | id-function | identity-operator | recursion | __all__-attribute | asyncio | complex-number | operator-and | generator | methods | memory-management | round | sum() | statement | boolean | set | encapsulation | list-mutation | counter | control-flow | slicing | comparison | multithreading | string-method | file-handling | exception-handling | thread | sys-module | loop-control | escape-operator | filter-function | installation | slice | return-statement | swapping | frozenset | matplotlib | string-formatting | global-variable | complex | compute | shallow-copy | syntax | implementation | arithmetic-expression | format | arithmetic-operation | sys | center | asyncio-module | conditional-statement | string-formatting | oops | precedence-and-associativity | package-management | encoding | multiple-inheritance | exponentiation | postfix | conditional-statement | pseudocode | map-function | min-max-function | python | loop | __future__ | function-and-scope | filter | conversion | gil | version-check | docstring | with-statement ...