Level 1 : What is the output for the below code?


list = [1, 2, 3, 4, 5]
value = [x&1 for x in list]
print(value)

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