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


a = [1, 2, 3, 4]
b = [3, 4, 5, 6]
c = [x for x in a if x not in b]
print(c)

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