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


fruits = ["apple", "banana", "cherry", "kiwi", "mango"]
newlist = [x for x in fruits if "a" in x]

print(newlist)

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