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


x = [i**+1 for i in range(3)]; print(x);

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