Level 3 : What will be the value of ‘result’ in following Python program?


list1 = [1,2,3,4]
list2 = [2,4,5,6]
list3 = [2,6,7,8]
result = list()
result.extend(i for i in list1 if i not in (list2+list3) and i not in result)
result.extend(i for i in list2 if i not in (list1+list3) and i not in result)
result.extend(i for i in list3 if i not in (list1+list2) and i not in result)

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