Level 1 : What will be the output of the following code?


i=1
while i < 4:
  print(i, end =' ')
  i++
  print(i+1, end=' ')

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