Level 5 : What is the output?


a = [1, 2, 3]
b = (x*x for x in a)
a.append(4)
print(list(b))

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