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


a = [[], "abc", [0], 1, 0]
print(list(filter(bool, a)))

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